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

Searching for urls with semicolons fails because URL sent to backend is cutoff before the first semicolon in the url #656

Closed
maeb opened this issue Jul 6, 2021 · 1 comment

Comments

@maeb
Copy link
Contributor

maeb commented Jul 6, 2021

var query = [window.wb_prefix + '*?url=' + url];

The url search parameter (every search parameter) should be encoded like this:
var query = [window.wb_prefix + '*?url=' + encodeURIComponent(url)];

Example:

cdx?url=https://akamai.vgc.no/drfront/images/2021/07/05/c=0,58,2000,440;w=1080;h=238;617673.jpg&output=json

gets converted in the backend to a request like the following to the cdxj api server:

index?url=https%3A//akamai.vgc.no/drfront/images/2021/07/05/c%3D0%2C58%2C2000%2C440&closest=&matchType=prefix

EDIT: add example

@maeb
Copy link
Contributor Author

maeb commented Jul 6, 2021

Referencing https://datatracker.ietf.org/doc/html/rfc3986#appendix-A that confirms semicolon is member of the sub-delims set of characters in the path segment of an URL.

EDIT: clarification

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