[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] [servlet] ProxyServlet handling of paths with extensions

In ProxyServlet.processAlias, when an alias is passed with an extension, the
following code executes:

    registration = (Registration) registrations.get(alias + extensionAlias);
    if (registration != null) // extensions should be handled on the full
        alias = HttpServletRequestAdaptor.getDispatchPathInfo(req);
        registration = (Registration) registrations.get(alias);

Now, if the registration is not null, then this code sets the alias to the
entire request path. However, the following code in
ResourceRegistration.handleRequest subsequently fails:

    String pathInfo = HttpServletRequestAdaptor.getDispatchPathInfo(req);
    int aliasLength = alias.equals("/") ? 0 : alias.length(); //$NON-NLS-1$
    String resourcePath = internalName + pathInfo.substring(aliasLength);
    URL testURL = httpContext.getResource(resourcePath);

because pathInfo has the same value as alias, so
pathInfo.substring(aliasLength) always results in a resourcePath of

The following patch fixes all of my use cases:


Raman Gupta

View this message in context: http://www.nabble.com/-servlet--ProxyServlet-handling-of-paths-with-extensions-tf3962018.html#a11243866
Sent from the Equinox - Dev mailing list archive at Nabble.com.