-
Notifications
You must be signed in to change notification settings - Fork 43
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
Clarify path param (URI template) matching behavior of trailing '/' in incoming path #195
Comments
@glassfishrobot Commented |
@glassfishrobot Commented I currently prefer the position that /a/b != /a/b/ and that /a/b/ does not match /a/{var} This is closely aligned with how to handle //. |
@glassfishrobot Commented |
@glassfishrobot Commented |
|
This is covered (arguably indirectly) in the current specification text where it states:
That means |
Looking at the Tomcat unit tests I see there is an explicit test that /a/{var} does not match /a/b/ as a result of EG discussion. Signed-off-by: Mark Thomas <markt@apache.org>
As mentioned in jsr356-experts:
http://java.net/projects/websocket-spec/lists/jsr356-experts/archive/2013-04/message/15
In the email http://java.net/projects/websocket-spec/lists/jsr356-experts/archive/2013-03/message/33
From: Danny Coward
Subject: Closing the gaps in the URI matching specification
Date: Mon, 18 Mar 2013 17:12:35 -0700
He gives a particular example ...
(snip)
suppose we have three endpoints and their paths:
endpoint A: /a/{var}/c
endpoint B: /a/b/c
endpoint C: /a/{var1}/{var2}
incoming URI: a/b/c matches B, not A or C, because an exact match is preferred.
incoming URI: a/d/c matches A with variable var=d, because like goldlocks, its just right
incoming URI: a/x/y/ matches C, with var1=x, var2=y
(/snip)
I have issue with In the last match of incoming path "a/x/y/" (note the trailing slash)
I feel this is a bad behavior of the matching.
A scenario to ponder this behavioral quirk.
endpoint A: "/a/{var}/c/"
endpoint B: "/a/b/c"
endpoint C: "/a/{var1}/{var2}"
endpoint D: "/a/{var1}/{var2}/{var3}"
What should the incoming path "/a/x/y/" match?
Is it endpoint C with ...
var1 = "x"
var2 = "y"
or is it endpoint D with ...
var1 = "x"
var2 = "y"
var3 = ""
I don't think it should match C as the incoming path has the trailing slash indicating another path segment.
Since we are calling this whole concept PathParam, I feel that this would keep us consistent as well.
The text was updated successfully, but these errors were encountered: