You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by GitBox <gi...@apache.org> on 2018/12/07 12:13:16 UTC

[GitHub] amarkevich commented on a change in pull request #481: CXF-7923 String.split via fastpath instead of precompiled Pattern

amarkevich commented on a change in pull request #481: CXF-7923 String.split via fastpath instead of precompiled Pattern
URL: https://github.com/apache/cxf/pull/481#discussion_r239787384
 
 

 ##########
 File path: rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java
 ##########
 @@ -254,10 +257,15 @@ public MediaType getMediaType() {
         return getHeaderValues(headerName, originalValue, DEFAULT_SEPARATOR);
     }
 
-    private List<String> getHeaderValues(String headerName, String originalValue, String sep) {
+    private static List<String> getHeaderValues(String headerName, String originalValue, String sep) {
         if (!originalValue.contains(QUOTE)
             || HEADERS_WITH_POSSIBLE_QUOTES.contains(headerName)) {
-            String[] ls = StringUtils.split(originalValue, sep);
+            final String[] ls; 
+            if (COOKIE_SEPARATOR_CRLF_EXPRESSION != sep) {
+                ls = originalValue.split(sep);
+            } else {
+                ls = COOKIE_SEPARATOR_CRLF_PATTERN.split(originalValue);
+            }
 
 Review comment:
   only CRLF accepted (HttpHeadersImplTest#testInvalidCookieSeparator)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services