transfer.sh does not support cross origin request #219

Closed
opened 2026-01-19 18:29:28 +00:00 by michael · 4 comments
Owner

Originally created by @opoto on GitHub.

Hello

transfer.sh does not support CORS request (cross-origin request). This is needed to allow it to be used through REST API from a web page javascript. Today any Ajax request to transfer.sh from a hosted javascript is rejected by the browser.

To support CORS, it has to:

  • Accept/serve OPTIONS requests
  • Add following headers to your all OPTIONS/GET/PUT/POST/DELETE HTTP responses:
    Access-Control-Allow-Origin: *
    Access-Control-Allow-Methods: PUT, POST, GET, OPTIONS, DELETE

Check this page to know more on CORS:
https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

Thanks for this nice tool

Originally created by @opoto on GitHub. Hello transfer.sh does not support CORS request (cross-origin request). This is needed to allow it to be used through REST API from a web page javascript. Today any Ajax request to transfer.sh from a hosted javascript is rejected by the browser. To support CORS, it has to: - Accept/serve OPTIONS requests - Add following headers to your all OPTIONS/GET/PUT/POST/DELETE HTTP responses: Access-Control-Allow-Origin: * Access-Control-Allow-Methods: PUT, POST, GET, OPTIONS, DELETE Check this page to know more on CORS: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS Thanks for this nice tool
Author
Owner

@paolafrancesca commented on GitHub:

@opoto can you check #297 branch?

unluckiley cors middleware for gorilla mux doesn't block at all invalid CORS requests so everything is left to client side validation

@paolafrancesca commented on GitHub: @opoto can you check #297 branch? unluckiley cors middleware for gorilla mux doesn't block at all invalid CORS requests so everything is left to client side validation
Author
Owner

@opoto commented on GitHub:

Thanks for the quick update!
Code looks good, but I don't have the environment to test. Do you have a test env I can try?

@opoto commented on GitHub: Thanks for the quick update! Code looks good, but I don't have the environment to test. Do you have a test env I can try?
Author
Owner

@opoto commented on GitHub:

Sorry for the confusion. But the contact link on https://transfer.sh leads to this GitHub project!
Hopefully they will deploy this patch some day!
Thanks.

@opoto commented on GitHub: Sorry for the confusion. But the contact link on https://transfer.sh leads to this GitHub project! Hopefully they will deploy this patch some day! Thanks.
Author
Owner

@paolafrancesca commented on GitHub:

@opoto then my update won't be of any use: This project repository has no relation with the service at https://transfer.sh that's managed by https://storj.io. So far we cannot address any issue related to the service at https://transfer.sh.

I thought you were referring to a self hosted instance of the service

@paolafrancesca commented on GitHub: @opoto then my update won't be of any use: This project repository has no relation with the service at https://transfer.sh that's managed by https://storj.io. So far we cannot address any issue related to the service at https://transfer.sh. I thought you were referring to a self hosted instance of the service
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dutchcoders/transfer.sh#219