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 historical redirects in view mode #110

Merged
merged 6 commits into from
Feb 25, 2023

Conversation

Mr0grog
Copy link
Member

@Mr0grog Mr0grog commented Feb 23, 2023

When requesting mementos of redirects in view mode, we get back a web page that redirects in JavaScript and that is missing some important memento headers, causing us to raise a pretty unexpected error. This attempts to work around the issue and detect that a page is a memento of a redirect.

This is a first pass, and might need some cleanup.

Fixes #109.

Redirects are messy in view mode (see #109). This adds a test for them, even though it currently fails.
When requesting mementos of redirects in `view` mode, we get back a web page that redirects in JavaScript and that is missing some important memento headers, causing us to raise a pretty unexpected error. This attempts to work around the issue and detect that a page is a memento of a redirect.

This is a first pass, and probably needs some more cleanup.

Fixes #109.
wayback/_client.py Outdated Show resolved Hide resolved
@Mr0grog
Copy link
Member Author

Mr0grog commented Feb 23, 2023

Also needs release notes.

This accounts for more possible cases, and scopes the URL down to just targets with the same timestamp (hopefully more accurate if there are ever more links to archived pages added to a redirect).
@Mr0grog Mr0grog merged commit 992be2d into main Feb 25, 2023
@Mr0grog Mr0grog deleted the 109-not-all-redirects-are-actually-redirects branch February 25, 2023 22:51
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.

Mementos of redirects in view mode raise "could not be played" error
1 participant