Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug? When there is a redirect then Response headers seem to be the headers from the first request, not the last one. #2548

Open
felixwatts opened this issue Feb 10, 2025 · 1 comment

Comments

@felixwatts
Copy link

Let me illustrate this with an example:

If I request this URL:

https://www.woodlandtrust.org.uk/media/31398/white-willow-twig-with-leaves-in-summer-alamy-b3b978-wildlife-gmbh.jpg?center=0.5074626865671642,0.46218487394957986&mode=crop&heightratio=0.5622047244094488188976377953&width=647&rnd=132102663080000000

The the response is a 302 Found with the following headers:

Content-Type: text/html
Location: https://wtlivewebtierstorage.blob.core.windows.net/cache/c/b/7/d/f/3/cb7df3282ae08a454e6c7ba01f3ad4355f04a538.jpg

Requesting the Location URL we get the headers:

Content-Type: image/jpeg

However, doing request::get on the first URL produces a Response with the body of the second, but with Content-Type: text/html.

This seems wrong and I can't find a way to access the correct header of image/jpeg.

Am I missing something?

@seanmonstar
Copy link
Owner

Are you sure? What if you enable connection_verbose(true), and enable trace level logs? You can see all the bytes on the connection. I'm not able to reproduce, myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants