View | Details | Raw Unified | Return to bug 62150
Collapse All | Expand All

(-)java/org/apache/catalina/core/ApplicationContext.java (-2 / +3 lines)
Lines 422-427 Link Here
422
        if (normalizedPath == null) {
422
        if (normalizedPath == null) {
423
            return null;
423
            return null;
424
        }
424
        }
425
        String baseUri = normalizedPath;
425
426
426
        if (getContext().getDispatchersUseEncodedPaths()) {
427
        if (getContext().getDispatchersUseEncodedPaths()) {
427
            // Decode
428
            // Decode
Lines 443-455 Link Here
443
            }
444
            }
444
445
445
            // URI needs to include the context path
446
            // URI needs to include the context path
446
            uri = URLEncoder.DEFAULT.encode(getContextPath(), StandardCharsets.UTF_8) + uri;
447
            uri = URLEncoder.DEFAULT.encode(getContextPath(), StandardCharsets.UTF_8) + baseUri;
447
        } else {
448
        } else {
448
            // uri is passed to the constructor for ApplicationDispatcher and is
449
            // uri is passed to the constructor for ApplicationDispatcher and is
449
            // ultimately used as the value for getRequestURI() which returns
450
            // ultimately used as the value for getRequestURI() which returns
450
            // encoded values. Therefore, since the value passed in for path
451
            // encoded values. Therefore, since the value passed in for path
451
            // was decoded, encode uri here.
452
            // was decoded, encode uri here.
452
            uri = URLEncoder.DEFAULT.encode(getContextPath() + uri, StandardCharsets.UTF_8);
453
            uri = URLEncoder.DEFAULT.encode(getContextPath() + baseUri, StandardCharsets.UTF_8);
453
        }
454
        }
454
455
455
        pos = normalizedPath.length();
456
        pos = normalizedPath.length();

Return to bug 62150