Skip to main content

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

Roman, please open a bug report against equinox / bundle. Thx for the
patch.

PaScaL


                                                                           
             Raman Gupta                                                   
             <rocketraman@fast                                             
             mail.fm>                                                   To 
             Sent by:                  equinox-dev@xxxxxxxxxxx             
             equinox-dev-bounc                                          cc 
             es@xxxxxxxxxxx                                                
                                                                   Subject 
                                       [equinox-dev] [servlet]             
             06/21/2007 07:50          ProxyServlet handling of paths with 
             PM                        extensions                          
                                                                           
                                                                           
             Please respond to                                             
                  Equinox                                                  
                development                                                
               mailing list                                                
             <equinox-dev@ecli                                             
                 pse.org>                                                  
                                                                           
                                                                           





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
        alias = HttpServletRequestAdaptor.getDispatchPathInfo(req);
    else
        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
internalName.

The following patch fixes all of my use cases:

http://pastebin.ca/582438

Cheers,
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.

_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev




Back to the top