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

Profile URLs not found for entities that redirect #45

Open
graue opened this issue Dec 6, 2012 · 0 comments
Open

Profile URLs not found for entities that redirect #45

graue opened this issue Dec 6, 2012 · 0 comments

Comments

@graue
Copy link

graue commented Dec 6, 2012

My server is set to redirect all HTTP requests from http://scott.mn to https://scott.mn, and the latter is my entity URI. So if I put in http://scott.mn, python-tent-client should follow the redirect, find the Link: header at https://scott.mn, and successfully discover the profile URL (and from that, the API root).

What happens instead is that it fails to find any profile URLs.

Interestingly, http://graue.tent.is does work even though Tent.is redirects http to https in the same manner. But Tent.is uses both a Link: HTTP header and an HTML <link> tag, while my site uses only the HTTP header.

So I suspect what's happening is that Requests doesn't follow a redirect when you do a HEAD request, but does for a GET request. It's doing a HEAD against the http site and not finding any Link: headers. Then it's retrying as a GET but this time against the https site, but it's not noticing that the https site has Link: headers because you only check for the <link> tag in this case.

If that guess is correct, making Requests follow redirects during the initial HEAD request would fix this bug.

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

1 participant