@@ -169,7 +169,6 @@ public abstract class HttpRequestParser {
169169 private final String charset ;
170170 private final int maxCachedHeaderSize ;
171171 private final boolean allowUnescapedCharactersInUrl ;
172- private final boolean allowIDLessMatrixParams ;
173172
174173 private static final boolean [] ALLOWED_TARGET_CHARACTER = new boolean [256 ];
175174
@@ -217,7 +216,6 @@ public HttpRequestParser(OptionMap options) {
217216 charset = options .get (UndertowOptions .URL_CHARSET , StandardCharsets .UTF_8 .name ());
218217 maxCachedHeaderSize = options .get (UndertowOptions .MAX_CACHED_HEADER_SIZE , UndertowOptions .DEFAULT_MAX_CACHED_HEADER_SIZE );
219218 this .allowUnescapedCharactersInUrl = options .get (UndertowOptions .ALLOW_UNESCAPED_CHARACTERS_IN_URL , false );
220- this .allowIDLessMatrixParams = options .get (UndertowOptions .ALLOW_ID_LESS_MATRIX_PARAMETERS , UndertowOptions .DEFAULT_ALLOW_ID_LESS_MATRIX_PARAMETERS );
221219 }
222220
223221 public static final HttpRequestParser instance (final OptionMap options ) {
@@ -644,7 +642,7 @@ final void handlePathParameters(ByteBuffer buffer, ParseState state, HttpServerE
644642 if (decode && (next == '+' || next == '%' || next > 127 )) {
645643 urlDecodeRequired = true ;
646644 }
647- if (( next == '=' || ( next == ',' && this . allowIDLessMatrixParams )) && param == null ) {
645+ if (next == '=' && param == null ) {
648646 param = decode (stringBuilder .substring (pos ), urlDecodeRequired , state , true , true );
649647 urlDecodeRequired = false ;
650648 pos = stringBuilder .length () + 1 ;
@@ -670,11 +668,11 @@ final void handlePathParameters(ByteBuffer buffer, ParseState state, HttpServerE
670668 state .nextQueryParam = param ;
671669 }
672670
673- private void handleParsedParam (String paramName , String parameterValue , HttpServerExchange exchange , boolean urlDecodeRequired , ParseState state ) throws BadRequestException {
674- if (paramName == null ) {
675- exchange .addPathParam (decode (parameterValue , urlDecodeRequired , state , true , true ), "" );
671+ private void handleParsedParam (String previouslyParsedParam , String parsedParam , HttpServerExchange exchange , boolean urlDecodeRequired , ParseState state ) throws BadRequestException {
672+ if (previouslyParsedParam == null ) {
673+ exchange .addPathParam (decode (parsedParam , urlDecodeRequired , state , true , true ), "" );
676674 } else { // path param already parsed so parse and add the value
677- exchange .addPathParam (paramName , decode (parameterValue , urlDecodeRequired , state , true , true ));
675+ exchange .addPathParam (previouslyParsedParam , decode (parsedParam , urlDecodeRequired , state , true , true ));
678676 }
679677 }
680678
0 commit comments