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

Getting decoded request path parameter #4112

Closed
lynshi opened this issue Aug 8, 2022 · 0 comments · Fixed by #4126
Closed

Getting decoded request path parameter #4112

lynshi opened this issue Aug 8, 2022 · 0 comments · Fixed by #4126
Assignees
Labels
2.0.x Short-term improvements to 2.0 enhancement
Milestone

Comments

@lynshi
Copy link
Contributor

lynshi commented Aug 8, 2022

Is your feature request related to a problem? Please describe.
We talked about this in a previous email thread but since it didn't come out in 2.0.5 we might've lost track of it, so creating an issue just in case (I also didn't find an existing issue)! As discussed, the current code

  • URL decodes queries
  • URL decodes fragments

It does not

  • URL decode the path before dispatch
    • So "/foo bar" and "/foo%20bar" are two different endpoints
  • URL decode the path params after dispatch

This is believed to be intentional because of https://github.com/microsoft/CCF/blob/main/src/http/test/http_test.cpp#L393.

Describe the solution you'd like
While normalizing paths for dispatch could be a topic for future discussion, a more immediately useful method would be one like get_decoded_request_path_parms(), which returns URL-decoded path parameters (unlike the existing get_path_param(), which will return the path parameter, encoded).

Describe alternatives you've considered
Currently the application must explicitly do the decoding after fetching path parameters.

@achamayou achamayou added 2.0.x Short-term improvements to 2.0 p1 labels Aug 9, 2022
@shokouedamsr shokouedamsr added this to the 2.x milestone Aug 11, 2022
@MahatiC MahatiC self-assigned this Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0.x Short-term improvements to 2.0 enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants