-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
URI compliance modes for #6001 #6006
Conversation
…parators default modes allows both ambiguous separators and segments, but still forbids ambiguous parameters
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
…-ambiguous-uris Fix #6001 separate compliance modes for ambiguous URI segments, params and separators
Signed-off-by: gregw <gregw@webtide.com>
Fixed checkstyle
Improve names
Improved javadoc
@sbordet I've updated the names and the javadoc |
jetty-http/src/main/java/org/eclipse/jetty/http/UriCompliance.java
Outdated
Show resolved
Hide resolved
jetty-http/src/main/java/org/eclipse/jetty/http/UriCompliance.java
Outdated
Show resolved
Hide resolved
jetty-http/src/main/java/org/eclipse/jetty/http/UriCompliance.java
Outdated
Show resolved
Hide resolved
updates after review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, apart the small niggle about EnumSet
usage.
private static final AtomicInteger __custom = new AtomicInteger(); | ||
|
||
public static UriCompliance valueOf(String name) | ||
{ | ||
for (UriCompliance compliance : KNOWN_MODES) | ||
for (UriCompliance compliance : Arrays.asList(DEFAULT, LEGACY, RFC3986, STRICT, SAFE)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not using EnumSet.allOf()
or similar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because they are not enums! They are just static final fields.
They were enums in 9, but that meant users could not define their own modes, so we have the CUSTOM[0-4] hack there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doh! Ship it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM apart EnumSet
usage.
Refactor the HttpCompliance changes of #6003 and #6002 for #6001 to a new UriCompliance class, changing default to SAFE