melbahja / got

Got: Simple golang package and CLI tool to download large files faster 🏃 than cURL and Wget!
MIT License
714 stars 45 forks source link

Error 403 when downloading from GitHub Releases #3

Closed pauloo27 closed 3 years ago

pauloo27 commented 4 years ago

I tried to download the binary from GitHub using got: got --out got.tar.gz https://github.com/melbahja/got/releases/download/v0.1.1/got_0.1.1_Linux_amd64.tar.gz

But instead I got Response status code is not ok: 403.

After a little search I found this issue https://github.com/cavaliercoder/grab/issues/43.

Basically AWS returns 403 to HEAD requests, changing the HEAD request to a GET at https://github.com/melbahja/got/blob/9098e5bee46ab083f6540eefeee23992fff91364/got.go#L275 worked but I am not sure if that's a good solution.

melbahja commented 4 years ago

The head request is to get content length and detect if the server supports partial content. in this case HEAD method is not supported, the solution I think is to send 1 byte GET request and from it detect content length and calculate concurrency chunks... I will see what I can do to solve this issue... Thank you for the report :)

mpldr commented 3 years ago

Similar Issue with https://speed.hetzner.de/100MB.bin but they just send EOF

melbahja commented 3 years ago

I'm working on simple solution for this, and we will ignore the HEAD errors completely when method not allowed.