Downloads.jl icon indicating copy to clipboard operation
Downloads.jl copied to clipboard

Testing issue with httpbingo v2.5.0+

Open staticfloat opened this issue 3 years ago • 0 comments

httpbingo recently updated their behavior to no longer provide the content-length header on their image/jpeg resource. This breaks the tests here.

Here is a minimal example that shows the difference between the live https://httpbingo.org site, and our version, which is locked to an older release:

julia> using Downloads
       url = "https://httpbingo.org/image/jpeg"
       resp = request(url; method="HEAD")
       haskey(Dict(resp.headers), "content-length")
false

julia> using Downloads
       url = "https://httpbingo.julialang.org/image/jpeg"
       resp = request(url; method="HEAD")
       haskey(Dict(resp.headers), "content-length")
true 

Getting a header dump from curl:

$ curl --HEAD https://httpbingo.org/image/jpeg
HTTP/2 200 
access-control-allow-credentials: true
access-control-allow-origin: *
content-type: image/jpeg
date: Tue, 15 Nov 2022 21:22:05 GMT
server: Fly/5f2bf728 (2022-11-11)
via: 2 fly.io
fly-request-id: 01GHYJQBW2TVHEJF1AV19Q8K5W-sea
$ curl --HEAD https://httpbingo.julialang.org/image/jpeg
HTTP/1.1 200 OK
Server: nginx/1.19.8
Date: Tue, 15 Nov 2022 21:22:27 GMT
Content-Type: image/jpeg
Content-Length: 35588
Connection: keep-alive
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *

You can also run the entire test suite against the upstream httpbingo.org server by redefining this variable.

staticfloat avatar Nov 15 '22 21:11 staticfloat