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

Handle schemeless URLs in Location header #61

Merged
merged 1 commit into from Nov 6, 2020

Conversation

Mr0grog
Copy link
Member

@Mr0grog Mr0grog commented Nov 6, 2020

In #60, we fixed an issue where redirects were path-based, but didn't handle redirects that were schemeless (i.e. they have a host but no scheme). Rather than adding more logic for this, I remembered Python has a built in method -- urljoin() -- for resolving relative URLs that handles both these cases (and probably a few others, like non-absolute paths). We should have used it in the first place!

In #60, we fixed an issue where redirects were path-based, but didn't handle redirects that were schemeless (i.e. they have a host but no scheme). Rather than adding more logic for this, I remembered Python has a built in method -- `urljoin()` -- for resolving relative URLs that handles both these cases (and probably a few others, like non-absolute paths). We should have used it in the first place!
@Mr0grog Mr0grog merged commit 732d33c into main Nov 6, 2020
@Mr0grog Mr0grog deleted the some-redirects-are-also-schemeless branch November 6, 2020 01:35
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

Successfully merging this pull request may close these issues.

None yet

1 participant