jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marc Speck" <marcsp...@gmail.com>
Subject Secured reverse proxy for WebDav
Date Thu, 13 Nov 2008 10:21:51 GMT
I want to reverse proxy webdav access with Apache 2.2. Besides routing and
other stuff, the web server also encrypts the connections. While this works
fine with ProxyPass and ProxyPreserveHost for the host name, it fails for
sending the decrypted request from Apache to Jackrabbit. The reason is that
Jackrabbit cannot know that it is supposed to deliver encrypted links in his
responses.

I think the problem/solution lies in the constructor of WebdavRequestImpl.
Instead of creating hrefPrefix in the constructor of WebdavRequestImpl,
could it be passed by the AbstractWebdavServlet.service() method? The
following change enables implementations of AbstractWebdavServlet to parse
their particular hrefPrefixes:

Index: AbstractWebdavServlet.java
===================================================================
--- AbstractWebdavServlet.java    (revision 713696)
+++ AbstractWebdavServlet.java    (working copy)
@@ -176,7 +176,7 @@
     protected void service(HttpServletRequest request, HttpServletResponse
response)
             throws ServletException, IOException {

-        WebdavRequest webdavRequest = new WebdavRequestImpl(request,
getLocatorFactory());
+        WebdavRequest webdavRequest = new WebdavRequestImpl(request,
getLocatorFactory(), getHrefPrefix(request));
         // DeltaV requires 'Cache-Control' header for all methods except
'VERSION-CONTROL' and 'REPORT'.
         int methodCode = DavMethods.getMethodCode(request.getMethod());
         boolean noCache = DavMethods.isDeltaVMethod(webdavRequest) &&
!(DavMethods.DAV_VERSION_CONTROL == methodCode || DavMethods.DAV_REPORT ==
methodCode);
@@ -209,6 +209,12 @@
         }
     }

+    protected String getHrefPrefix(HttpServletRequest request) {
+        String host = request.getHeader("Host");
+        String scheme = request.getScheme();
+        return scheme + "://" + host + request.getContextPath();
+    }
+
     /**
      * Executes the respective method in the given webdav context
      *



Sure enough, I'm also happy to learn about existing/better solutions...
Marc

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message