19
19
import java .io .UnsupportedEncodingException ;
20
20
import java .net .URLDecoder ;
21
21
import java .util .LinkedHashMap ;
22
+ import java .util .List ;
22
23
import java .util .Map ;
23
24
import java .util .Properties ;
24
25
import javax .servlet .http .HttpServletRequest ;
@@ -494,7 +495,7 @@ protected String determineEncoding(HttpServletRequest request) {
494
495
495
496
/**
496
497
* Remove ";" (semicolon) content from the given request URI if the
497
- * {@linkplain #setRemoveSemicolonContent(boolean) removeSemicolonContent}
498
+ * {@linkplain #setRemoveSemicolonContent removeSemicolonContent}
498
499
* property is set to "true". Note that "jssessionid" is always removed.
499
500
* @param requestUri the request URI string to remove ";" content from
500
501
* @return the updated URI string
@@ -526,12 +527,10 @@ private String removeJsessionid(String requestUri) {
526
527
}
527
528
528
529
/**
529
- * Decode the given URI path variables via
530
- * {@link #decodeRequestString(HttpServletRequest, String)} unless
531
- * {@link #setUrlDecode(boolean)} is set to {@code true} in which case it is
532
- * assumed the URL path from which the variables were extracted is already
533
- * decoded through a call to
534
- * {@link #getLookupPathForRequest(HttpServletRequest)}.
530
+ * Decode the given URI path variables via {@link #decodeRequestString} unless
531
+ * {@link #setUrlDecode} is set to {@code true} in which case it is assumed
532
+ * the URL path from which the variables were extracted is already decoded
533
+ * through a call to {@link #getLookupPathForRequest(HttpServletRequest)}.
535
534
* @param request current HTTP request
536
535
* @param vars URI variables extracted from the URL path
537
536
* @return the same Map or a new Map instance
@@ -550,25 +549,25 @@ public Map<String, String> decodePathVariables(HttpServletRequest request, Map<S
550
549
}
551
550
552
551
/**
553
- * Decode the given matrix variables via
554
- * {@link #decodeRequestString(HttpServletRequest, String)} unless
555
- * {@link #setUrlDecode(boolean)} is set to {@code true} in which case it is
556
- * assumed the URL path from which the variables were extracted is already
557
- * decoded through a call to
558
- * {@link #getLookupPathForRequest(HttpServletRequest)}.
552
+ * Decode the given matrix variables via {@link #decodeRequestString} unless
553
+ * {@link #setUrlDecode} is set to {@code true} in which case it is assumed
554
+ * the URL path from which the variables were extracted is already decoded
555
+ * through a call to {@link #getLookupPathForRequest(HttpServletRequest)}.
559
556
* @param request current HTTP request
560
557
* @param vars URI variables extracted from the URL path
561
558
* @return the same Map or a new Map instance
562
559
*/
563
- public MultiValueMap <String , String > decodeMatrixVariables (HttpServletRequest request , MultiValueMap <String , String > vars ) {
560
+ public MultiValueMap <String , String > decodeMatrixVariables (
561
+ HttpServletRequest request , MultiValueMap <String , String > vars ) {
562
+
564
563
if (this .urlDecode ) {
565
564
return vars ;
566
565
}
567
566
else {
568
- MultiValueMap <String , String > decodedVars = new LinkedMultiValueMap <String , String >(vars .size ());
569
- for (String key : vars .keySet ()) {
570
- for (String value : vars . get ( key )) {
571
- decodedVars .add (key , decodeInternal (request , value ));
567
+ MultiValueMap <String , String > decodedVars = new LinkedMultiValueMap <String , String >(vars .size ());
568
+ for (Map . Entry < String , List < String >> entry : vars .entrySet ()) {
569
+ for (String value : entry . getValue ( )) {
570
+ decodedVars .add (entry . getKey () , decodeInternal (request , value ));
572
571
}
573
572
}
574
573
return decodedVars ;
0 commit comments