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

Jersey should decode @Path before evaluating the regex #446

Closed
jerseyrobot opened this issue Dec 29, 2008 · 8 comments
Closed

Jersey should decode @Path before evaluating the regex #446

jerseyrobot opened this issue Dec 29, 2008 · 8 comments

Comments

@jerseyrobot
Copy link
Contributor

Currently Jersey runs the regular expression against the encoded string. This
makes it impossible to use
s and other regular expressions to match @path
parameters.

See
http://n2.nabble.com/Shouldn%27t-Jersey-decode-%40Path-before-matching-the-regex--tt2089825.html
for more information.

Environment

Operating System: All
Platform: All

Affected Versions

[1.0.1]

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
Reported by cowwoc@java.net

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
Was assigned to jersey-issues

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
sandoz@java.net said:
URI template variable specifications are ignored:

https://jsr311.dev.java.net/nonav/releases/1.0/spec/spec3.html#x3-370003.7.3

If you want this support i recommend logging an issue against JSR 311. It is
certainly a lot of work to implement as it requires a regex parser with the
ability to access the tokens of the regex to determine literal characters of the
regex.

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
Marked as incomplete on Sunday, January 4th 2009, 9:07:47 pm

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
This issue was imported from java.net JIRA JERSEY-174

@jerseyrobot
Copy link
Contributor Author

@johnmanko
Copy link

I think issue should be reopened. In referencing my Stackoverflow post, this appears to be a continuing problem.

The pattern:

@Path("/{code: [A-Z0-9][A-Z0-9\\s-]{0,10}[A-Z0-9]}")

should match ABC%20XYZ, but it doesn't. Instead, it fails with a 404. Removing the encoded space (%20) does match against the path.

@johnmanko
Copy link

johnmanko commented May 26, 2021

cc @jansupol @joschi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants