Closed dosuken123 closed 3 years ago
cc @stanhu @kwilczynski
Hello everyone!
There is an on-going effort from @stanhu to move the implementation of a custom download to use the mini_portile
Ruby Gem, similarly to what Nokogiri uses at the moment, and thus I wonder moving to it would solve the problem with our request lacking things such as User-Agent
, etc. I assume that mini_portile
might be a little be more behaved (although, I haven't verified yet whether it does set all the things as required).
More at https://github.com/kwilczynski/ruby-magic/pull/5.
Krzysztof
@kwilczynski I'm now seeing this 412 with mini_portile
:
Using mini_portile version 2.5.0
2 retrie(s) left for file-5.39.tar.gz
1 retrie(s) left for file-5.39.tar.gz
0 retrie(s) left for file-5.39.tar.gz
412 Precondition Failed
*** extconf.rb failed ***
I've tried this PR on my local machine and it seems to have worked... but I'm not sure if we just didn't reached the "rate limit" for the new User-Agent or not.
Note that URI.open
uses Ruby
as the User-Agent
. I suspect there might be rate-limiting by User-Agent
.
This commit fixes the
OpenURI::HTTPError
when thegem install ruby-magic
runs.It looks like
User-Agent
must be specified when the system downloads a file from fossies.Confirmed in the following test script: