reta commented on code in PR #1483:
URL: https://github.com/apache/cxf/pull/1483#discussion_r1369416097
##########
rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java:
##########
@@ -93,13 +93,18 @@ public final class HttpUtils {
// there are more of such characters, ex, '*' but '*' is not affected by
UrlEncode
private static final String PATH_RESERVED_CHARACTERS = "=@/:!$&\'(),;~";
private static final String QUERY_RESERVED_CHARACTERS = "?/,";
-
+
private static final Set<String> KNOWN_HTTP_VERBS_WITH_NO_REQUEST_CONTENT =
new HashSet<>(Arrays.asList(new String[]{"GET", "HEAD", "OPTIONS",
"TRACE"}));
private static final Set<String> KNOWN_HTTP_VERBS_WITH_NO_RESPONSE_CONTENT
=
new HashSet<>(Arrays.asList(new String[]{"HEAD", "OPTIONS"}));
-
- private static final Pattern HTTP_SCHEME_PATTERN =
Pattern.compile("^(?i)(http|https)$");
Review Comment:
This pattern is super straightforward to look up, what is exactly the gains
here (vs adding the set + comparator + lowecasing)?
##########
rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java:
##########
@@ -93,13 +93,18 @@ public final class HttpUtils {
// there are more of such characters, ex, '*' but '*' is not affected by
UrlEncode
private static final String PATH_RESERVED_CHARACTERS = "=@/:!$&\'(),;~";
private static final String QUERY_RESERVED_CHARACTERS = "?/,";
-
+
private static final Set<String> KNOWN_HTTP_VERBS_WITH_NO_REQUEST_CONTENT =
new HashSet<>(Arrays.asList(new String[]{"GET", "HEAD", "OPTIONS",
"TRACE"}));
private static final Set<String> KNOWN_HTTP_VERBS_WITH_NO_RESPONSE_CONTENT
=
new HashSet<>(Arrays.asList(new String[]{"HEAD", "OPTIONS"}));
-
- private static final Pattern HTTP_SCHEME_PATTERN =
Pattern.compile("^(?i)(http|https)$");
Review Comment:
This pattern is super straightforward to look up, what are exactly the gains
here (vs adding the set + comparator + lowecasing)?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]