OpenNTF/SocialSDK

Issue with the proxy

Opened this issue · 0 comments

The proxy service is calling getPathInfo() to compose the URL to redirect to but, according to the J2EE spec, this is decoding the URL while the proxy should pass it as is. For example, if the URL path contains an encoded '/', this should not be decoded. On the other hand, getRequestURI() returns the raw path, so this is what should be used.
The code in ProxyEndpointService should be changed as shown bellow:

    @Override
    protected void initProxy(HttpServletRequest request, HttpServletResponse response)
            throws ServletException {
        // PHIL: Fix the pathinfo to get it encoded
        //String pathInfo = request.getPathInfo();
        String _reqURI = request.getRequestURI();
        int w = _reqURI.indexOf("/proxy/");
        String pathInfo = _reqURI.substring(w);