apache: relax rewrite_arg syntax release_20190105 release_20190105-1
authorClinton Ebadi <clinton@unknownlamer.org>
Fri, 4 Jan 2019 05:18:33 +0000 (00:18 -0500)
committerClinton Ebadi <clinton@unknownlamer.org>
Fri, 4 Jan 2019 05:30:10 +0000 (00:30 -0500)
This was too restrictive, making ENV flag essentially useless (there
is no way to access rewrite capture groups or other environment
variables).

This still forbids spaces; we could allow them, but would have to
ensure proper quoting or escaping and the apache parser for rewrite
arguments is pretty funky, so this seems to be of dubious value (read:
it would be a lot more work).

See https://bugzilla.hcoop.net/show_bug.cgi?id=1287 for background.

src/plugins/apache.sml

index 0c3e685..9d180ab 100644 (file)
@@ -97,7 +97,7 @@ val _ = Env.type_one "proxy_reverse_target"
 
 val _ = Env.type_one "rewrite_arg"
        Env.string
-       (CharVector.all Char.isAlphaNum)
+       (CharVector.all (fn ch => (Char.isGraph ch) andalso not (List.exists (fn c => ch = c) [ #"[", #"]", #",", #"\"", #"'", #"=", #":" ])))
 
 val _ = Env.type_one "suexec_flag"
        Env.bool