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

Use URI.open() instead of open(), plus properly escape query string parameters #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

morgant
Copy link

@morgant morgant commented May 19, 2024

This replaces deprecated uses of open() with URI.open() for compatibility with Ruby 3.x where it now causes fatal errors (see Issue #3.) It also adds some uses of CGI.escape() to ensure that the requested URL's query string parameters are properly escaped and not accidentally mixed with the WayBack Machine's query string parameters.

…with Ruby 3.x, plus added some CGI.escape() to ensure that the requested URL's query string parameters are handled correctly and not accidentally mixed with the WayBack Machine's query string parameters
…r#download_file as the URI should only be escaped when querying the WaybackMachine API, not when requesting files. Issue cocoflan#3
@morgant
Copy link
Author

morgant commented Jun 3, 2024

I have since noticed I incorrectly introduced CGI.escape() call in WaybackMachineDownloader#download_file, which causes unexpected issues if the requested file/path includes a query string. I have reverted that particular use, leaving it in-place in #get_raw_list_from_api, where it is still necessary.

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.

1 participant