New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Taildrop] - Unable to retrieve files that have "%XX" sequences #2288
Comments
I think I've narrowed it down to the |
Ok, so I think I may have been too hasty to call out an error in the code. I did some tests among a group of my devices and found that in summary, sending from either MacOS or iOS results in either 1) files copied with escape sequences or 2) files not being found as per my original comment. You can take a look at the full test results here: https://docs.google.com/spreadsheets/d/1nK_KWE-iwFSF8qldXn3tVIlv68Xofg1jt7QkbdB5oCQ/edit?usp=sharing If you don't want to look at the results, here are the devices I tested:
I tested sending a file with a space from each of the devices to each of the other devices. I have not tested platform to same platform. Success == means the file was received as sent (with the space) These tests lead me to suspect that the "Share" feature on Mac OS and iOS somehow either send the file pre-escaped to Tailscale or that the Tailscale front-end ands an additional layer of escaping. I don't actually have a way of verifying as the source to the Mac OS and iOS clients is closed. |
@sheran, wow, thanks for doing so much debugging for us! |
Yeah, the macOS/iOS clients (which send the file through a localapi helper handler that then does the peerapi PUT) ultimately send the request double-escaped:
It's also a bug that such requests get stuck in tailscaled without being able to retrieved out of the staging area. I'll fix that latter bug first, and then look at the macOS/iOS double escaping. |
The localapi was double-unescaping: once by net/http populating the URL, and once by ourselves later. We need to start with the raw escaped URL if we're doing it ourselves. Started to write a test but it got invasive. Will have to add those tests later in a commit that's not being cherry-picked to a release branch. Fixes #2288 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
The localapi was double-unescaping: once by net/http populating the URL, and once by ourselves later. We need to start with the raw escaped URL if we're doing it ourselves. Started to write a test but it got invasive. Will have to add those tests later in a commit that's not being cherry-picked to a release branch. Fixes #2288 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
The localapi was double-unescaping: once by net/http populating the URL, and once by ourselves later. We need to start with the raw escaped URL if we're doing it ourselves. Started to write a test but it got invasive. Will have to add those tests later in a commit that's not being cherry-picked to a release branch. Fixes #2288 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
The localapi was double-unescaping: once by net/http populating the URL, and once by ourselves later. We need to start with the raw escaped URL if we're doing it ourselves. Started to write a test but it got invasive. Will have to add those tests later in a commit that's not being cherry-picked to a release branch. Fixes #2288 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com> (cherry picked from commit 98ad7f2)
Sending file from: iOS 14.6 and Tailscale v 1.10.0
Receiving file on: Ubuntu Linux 20.04 and Tailscale v 1.10.0
Tailscale Account Type: Personal
I sent a file that had a space character ("QR code.png.png") to my Linux box. The file shows up on Linux as follows:
When an attempt to retrieve it is made, there is an error:
I traced the error to
./client/tailscale/tailscale.go
and theGetWaitingFile()
function. I believe the error occurs when the request is sent and the filename is url.PathEscape()'d. I added a Printf to check and this is the output of the request:This shows a request for the filename
QR%2520code.png.png
instead ofQR%20code.png.png
Happy to help fixing it, but I'm not entirely sure how a DCO works.
The text was updated successfully, but these errors were encountered: