WhiteCat22 commented on code in PR #1483:
URL: https://github.com/apache/cxf/pull/1483#discussion_r1380783800
##########
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:
Hi @reta , Sorry for the delay. The reason we changed this was because
`HashSet.contains(String)` uses "WAY" less CPU than
`Pattern.matcher(String).matches()`
--
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]