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

Improve Error messages for Ambiguous URIs #11457

Merged
merged 2 commits into from
Feb 28, 2024

Conversation

joakime
Copy link
Contributor

@joakime joakime commented Feb 27, 2024

Improves the error message / stacktrace to include the UriCompliance.Violation that occurred.

From

URI: /foo=bar%2Fbaz=baz
STATUS: 400
MESSAGE: Ambiguous URI encoding
SERVLET: jetty12.DemoJerseyConfig
CAUSED BY org.eclipse.jetty.http.HttpException$IllegalArgumentException: 400: Ambiguous URI encoding
org.eclipse.jetty.http.HttpException$IllegalArgumentException: 400: Ambiguous URI encoding
   at org.eclipse.jetty.ee10.servlet.ServletApiRequest$AmbiguousURI.getServletPath(ServletApiRequest.java:1325)
   at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:236)
   at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
   at org.eclipse.jetty.ee10.servlet.ServletHolder.handle(ServletHolder.java:736)

To

URI: /foo=bar%2Fbaz=baz
STATUS: 400
MESSAGE: Ambiguous URI encoding
SERVLET: jetty12.DemoJerseyConfig
CAUSED BY org.eclipse.jetty.http.HttpException$IllegalArgumentException: 400: Ambiguous URI encoding: AMBIGUOUS_PATH_SEPARATOR
org.eclipse.jetty.http.HttpException$IllegalArgumentException: 400: Ambiguous URI encoding: AMBIGUOUS_PATH_SEPARATOR
   at org.eclipse.jetty.ee10.servlet.ServletApiRequest$AmbiguousURI.getServletPath(ServletApiRequest.java:1325)
   at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:236)
   at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
   at org.eclipse.jetty.ee10.servlet.ServletHolder.handle(ServletHolder.java:736)

Fixes #11448

Copy link
Contributor

@gregw gregw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI failure looks like a flake

@joakime joakime merged commit 97cb50e into jetty-12.0.x Feb 28, 2024
8 checks passed
@joakime joakime deleted the fix/12.0.x/errorhandling-uri-raw branch February 28, 2024 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

UriCompliance.Violation ignored despite being set
2 participants