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

web::uri::validate returns false on uri with "":"" in query #1628

Open
zamx opened this issue Jun 21, 2021 · 1 comment · May be fixed by #1632
Open

web::uri::validate returns false on uri with "":"" in query #1628

zamx opened this issue Jun 21, 2021 · 1 comment · May be fixed by #1632

Comments

@zamx
Copy link

zamx commented Jun 21, 2021

web::uri::validate() wrongly assumes uri foo?bar=foo:bar is a absolute path because of the ":" in the query. RFC-3986 allows queries to contain ":".

@garethsb
Copy link
Contributor

garethsb commented Jul 1, 2021

I think you're right, I believe your example is a valid relative-ref.

Per RFC 3986 section 4.2:

relative-ref  = relative-part [ "?" query ] [ "#" fragment ]

Therefore, probably

for (; *p2 != _XPLATSTR('/') && *p2 != _XPLATSTR('\0'); p2++)

needs to also stop at ? or #...

An example like yours should be added to the test cases near relative_ref_string...

Edit: I now have a test case and fix, so I'll make a PR later.

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 a pull request may close this issue.

2 participants