]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_rewrite: Fix UDS ("unix:") scheme for [P] rules. PR 57691 + 65590.
authorYann Ylavic <ylavic@apache.org>
Wed, 22 Sep 2021 18:16:38 +0000 (18:16 +0000)
committerYann Ylavic <ylavic@apache.org>
Wed, 22 Sep 2021 18:16:38 +0000 (18:16 +0000)
Handle the unix: scheme as an obsolute URI or a rule like:
  RewriteRule ^/(.*) unix:/path/to/uds.sock|fcgi://localhost/$1 [P]
sets r->filename for /index.html as:
  proxy:http://www.example.com/unix:/path/to/uds.sock|http://localhost/index.html
instead of the expected:
  proxy:unix:/path/to/uds.sock|http://localhost/index.html

Submitted by: Janne Peltonen <janne.peltonen sange.fi>
Reviewed by: ylavic

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893516 13f79535-47bb-0310-9956-ffa450edef68

changes-entries/rewrite_uds.txt [new file with mode: 0644]
modules/mappers/mod_rewrite.c

diff --git a/changes-entries/rewrite_uds.txt b/changes-entries/rewrite_uds.txt
new file mode 100644 (file)
index 0000000..4b752a8
--- /dev/null
@@ -0,0 +1,2 @@
+  *) mod_rewrite: Fix UDS ("unix:") scheme for [P] rules.  PR 57691 + 65590.
+     [Janne Peltonen <janne.peltonen sange.fi>]
\ No newline at end of file
index 06d8a154370bbf81a0013150572849479e440b9a..dc21a8eb83b9cf1733d4763f4855e8c2f14b8eed 100644 (file)
@@ -653,6 +653,13 @@ static unsigned is_absolute_uri(char *uri, int *supportsqs)
             return 6;
         }
         break;
+
+    case 'u':
+    case 'U':
+        if (!ap_cstr_casecmpn(uri, "nix:", 4)) {        /* unix:     */
+            *sqs = 1;
+            return 5;
+        }
     }
 
     return 0;