mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2026-02-03 06:03:25 +00:00
upload a file to local host returns 301 #391
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @oren on GitHub.
I am installing the app using docker on my laptop. I get 301 when trying to upload a file.
curl -v --upload-file ./hello.txt http://localhost:8080/hello.txt
@nl5887 commented on GitHub:
Currently there is a redirect checking if the connection is secure. If not then it will redirect to https://transfer.sh/. Will work on a solution to disable the check.
@nl5887 commented on GitHub:
In the mean time, you can workaround this issue by removing the RedirectHandler in main.go, by changing:
to
@jasonyost commented on GitHub:
Just ran into this issue myself, the code for the redirect handler is looking for a host of
127.0.0.1in handlers.goChanging my curl command to
curl -v --upload-file ./hello.txt http://127.0.0.1:8080/hello.txtresolves the issue for me@mapio commented on GitHub:
I did it like https://github.com/mapio/transfer.sh/blob/master/transfersh-server/main.go#L172 and it now works!
[But I had to clean the browser caches to force it to forget the old "moved permanently"… dunno why!]
@mapio commented on GitHub:
This actually happens not only for an upload, but even accessing to the homepage!
I hope you'll fix it because I'd like to run this on a private network!
@acepsaepudin commented on GitHub:
thanks @jasonyost +1