httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 29678] New: - mod_rewrite used with authentication and mod_proxy returns an incorrect status code.
Date Fri, 18 Jun 2004 17:02:20 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29678>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29678

mod_rewrite used with authentication and mod_proxy returns an incorrect status code.

           Summary: mod_rewrite used with authentication and mod_proxy
                    returns an incorrect status code.
           Product: Apache httpd-2.0
           Version: 2.0.49
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: mod_rewrite
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: maciej-apache@killer-robot.net


Accessing a URI rewritten with the [P] flag by a proxy set up to require
authentication yields a 401 (Authentication Required) and not a 407 (Proxy
Authentication Required) response. More generally, mod_rewrite flags every [P]
request it processes as a PROXYREQ_REVERSE; when the request in question is
already being handled through the normal proxy, it is more appropriate to leave
it as PROXYREQ_PROXY. The patch below (against 2.0.49) fixes the issue for me.


--- httpd-2.0.49.old/modules/mappers/mod_rewrite.c      Mon Feb  9 14:53:18 2004
+++ httpd-2.0.49/modules/mappers/mod_rewrite.c  Thu Jun 17 13:34:33 2004
@@ -1202,8 +1202,11 @@
                                           "?", r->args, NULL);
             }
 
-            /* now make sure the request gets handled by the proxy handler */
-            r->proxyreq = PROXYREQ_REVERSE;
+            /* now make sure the request gets handled by the proxy handler.
+               Forward-proxy requests shouldn't get relabeled */
+            if(PROXYREQ_PROXY != r->proxyreq)
+               r->proxyreq = PROXYREQ_REVERSE;
+
             r->handler  = "proxy-server";
 
             rewritelog(r, 1, "go-ahead with proxy request %s [OK]",

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message