-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Do server variables allow unencoded slashes? #2421
Comments
My preference would be to align with the path restrictions and disallow forward slashes. That approach seems more consistent, and the implications of the Helen's rewritten example seem perfectly acceptable to me. Phil's language from #2218 seems appropriate here, too:
|
While I see and respect the argument for consistency, in the case of Here one server of several is selected to be used, unlike |
I concur with Mike - in my mind, these are not path variables, they are template variables
|
Are there real world examples that show why allowing slashes would help? Has this been a complaint in the past? I cannot think of any API whose server location depends on representing something like a nested folder structure. Without that, I still prefer the more constrained, consistent approach, but I'm not strongly opposed either way, tbh. |
Many years ago, I was writing a program that let you look up various information on a user given their username. Obviously, characters in the nickname that were outside the "reserved" set had to be URL encoded. I was quite disappointed that the platform I was using had difficulty using RFC 3986 specifies how encoding works not just mechanically, but semantically:
To answer OP, I would expect:
Yes
Note how the slashes are URL encoded in the absence of the |
The limitation on path templates is to prevent ambiguous resolution of operations. e.g.
In the case of server variables mapping to a different server URI does not have significant consequences. However preventing a a forward slash in a server variable would prevent multi-segment variable values. e.g.
If forward slashes are not intended to create path segments in the URL then the need to be a percent encoded. Nobody raised an objection to this in the TSC call because Marsh was missing :-) Hence the current wording of the spec is sufficient. |
By who? |
@awwright By the tooling providing the parameter value. The reference you quoted in RFC3986 is a good one and might warrant us adding words that indicate a server variable should not be treated as a "data octet" but as a literal portion of the URL. |
This is somewhat related to #2204 and #2218. It's been clarified that path parameters don't allow unescaped slashes, but what about server variables?
Consider this example:
Are these valid values for a server variable?
If yes - what is the resulting server URL for
subpath
=abc/123/
? --In other words, is the example above a proper way to vary subpaths using server variables, or should this example be rewritten as follows? --
The text was updated successfully, but these errors were encountered: