httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Zajac <>
Subject [PATCH <PR-24329>] - Fix for: mod_rewrite fully qualifies (corrupts) the substitution string for CONNECT requests
Date Fri, 02 Oct 2009 23:08:46 GMT
I hope someone from the official dev team can merge this into the next
release of apache httpd.

Please find attached an svn diff made against revision 820823 of:

This diff fixes the Bug 29744 on the Bugzilla:

This fix allows mod_rewrite to handle CONNECT requests (by not trying to
fully qualify the substitution string).
The current behavior is that mod_rewrite tries to connect to

I verified with the RFC (

   A CONNECT method requests that a proxy establish a tunnel connection
   on its behalf. The Request-URI portion of the Request-Line is always
   an 'authority' as defined by URI Generic Syntax [2], which is to say
   the host name and port number destination of the requested connection
   separated by a colon:

      CONNECT HTTP/1.1

This patch will allow a CONNECT request to simply connect to the host:port
specified in the substitution string of the rewrite rule.

The bug page listed above gives more details.

The patch is so small that I'm also pasting it into the body of this email
for your quick review.

--- mod_rewrite.c       (revision 820823)
+++ mod_rewrite.c       (working copy)
@@ -845,7 +845,10 @@
 static void fully_qualify_uri(request_rec *r)
-    if (!is_absolute_uri(r->filename)) {
+    if (r->method_number == M_CONNECT) {
+        return;
+    }
+    else if (!is_absolute_uri(r->filename)) {
         const char *thisserver;
         char *thisport;
         int port;

Hopefully this is enough detail to help.

Thank you,

View raw message