Fails on uploading favicon.ico #272

Closed
opened 2026-01-19 18:29:41 +00:00 by michael · 1 comment
Owner

Originally created by @kade-robertson on GitHub.

When uploading a file named favicon.ico to transfer.sh through the website, you get a bunch of garbled mess (I believe it's the data for your favicon) instead of a link to the upload.

This is presumably because it makes a PUT request to https://transfer.sh/favicon.ico which isn't/shouldn't be allowed. This is on Chrome 73.0.3683.86 on Mac OS 10.14.3:

Broken WebUI

When uploading using curl it's not quite as bad, since you receive a warning:

$ curl --upload-file ./favicon.ico https://transfer.sh/favicon.ico
Warning: Binary output can mess up your terminal. Use "--output -" to tell
Warning: curl to output it to your terminal anyway, or consider "--output
Warning: <FILE>" to save to a file.

And if you follow the warning, you get:

$ curl --upload-file ./favicon.ico https://transfer.sh/favicon.ico --output -
K�(K������������������������������������¼�ý�þ�þ��������Ý� ... # goes on

Which ends up being your favicon (as suspected):

transfer.ico

There should probably be some kind of warning if uploading a file that's invalid (or some way to handle this special case, i.e. not serving your favicon on a PUT if that's possible).

Originally created by @kade-robertson on GitHub. When uploading a file named `favicon.ico` to transfer.sh through the website, you get a bunch of garbled mess (I believe it's the data for your favicon) instead of a link to the upload. This is presumably because it makes a PUT request to `https://transfer.sh/favicon.ico` which isn't/shouldn't be allowed. This is on Chrome 73.0.3683.86 on Mac OS 10.14.3: <img width="734" alt="Broken WebUI" src="https://user-images.githubusercontent.com/8824774/55636084-2047e300-5790-11e9-9102-9f15d35b981f.png"> When uploading using `curl` it's not quite as bad, since you receive a warning: ```bash $ curl --upload-file ./favicon.ico https://transfer.sh/favicon.ico Warning: Binary output can mess up your terminal. Use "--output -" to tell Warning: curl to output it to your terminal anyway, or consider "--output Warning: <FILE>" to save to a file. ``` And if you follow the warning, you get: ```bash $ curl --upload-file ./favicon.ico https://transfer.sh/favicon.ico --output - K�(K������������������������������������¼�ý�þ�þ��������Ý� ... # goes on ``` Which ends up being your favicon (as suspected): ![transfer.ico](https://transfer.sh/Syyhq/transfer.ico) There should probably be some kind of warning if uploading a file that's invalid (or some way to handle this special case, i.e. not serving your favicon on a PUT if that's possible).
Author
Owner

@paolafrancesca commented on GitHub:

I will fix limiting http.FileServer handler only for GET requests. Anyway it is unlikely to see the fix on http://transfer.sh :)

@paolafrancesca commented on GitHub: I will fix limiting `http.FileServer` handler only for GET requests. Anyway it is unlikely to see the fix on http://transfer.sh :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dutchcoders/transfer.sh#272