kopia lustrzana https://github.com/alecmuffett/eotk
commit: slightly nicer generated code
rodzic
f2569d9ede
commit
e1f77730a6
|
@ -11,6 +11,8 @@ $indent = " ";
|
|||
@white = ();
|
||||
@tail = ();
|
||||
|
||||
$dont_onion = "set \$dont_onionify_response_headers 1; # dest URL must not be rewritten, prevent loops; cookies may migrate.";
|
||||
|
||||
sub blackwhite {
|
||||
my ($operator, $lc_what, $a, $b) = @_;
|
||||
my $uc_what = uc($lc_what);
|
||||
|
@ -90,7 +92,7 @@ while (<DATA>) {
|
|||
push(@redirect, "# redirect $lc_what: 1=regexp,2=code,3=dest (REQUEST_URI will be appended) $warning\n");
|
||||
push(@redirect, "%%CSV %$uc_what%\n");
|
||||
push(@redirect, "$condition {\n");
|
||||
push(@redirect, " set \$dont_onionify_response_headers 1;\n") if ($uc_what =~ /_HOST/); # this is a horrible kludge
|
||||
push(@redirect, " $dont_onion\n") if ($uc_what =~ /_HOST/); # this is a horrible kludge
|
||||
push(@redirect, " return %2% %3%\$request_uri;\n");
|
||||
push(@redirect, "}\n");
|
||||
push(@redirect, "%%ENDCSV\n");
|
||||
|
@ -104,7 +106,7 @@ while (<DATA>) {
|
|||
push(@redirect, "# fixed_redirect $lc_what: 1=regexp,2=code,3=dest (REQUEST_URI will NOT be appended) $warning\n");
|
||||
push(@redirect, "%%CSV %$uc_what%\n");
|
||||
push(@redirect, "$condition {\n");
|
||||
push(@redirect, " set \$dont_onionify_response_headers 1;\n") if ($uc_what =~ /_HOST/); # this is a horrible kludge
|
||||
push(@redirect, " $dont_onion\n") if ($uc_what =~ /_HOST/); # this is a horrible kludge
|
||||
push(@redirect, " return %2% %3%;\n");
|
||||
push(@redirect, "}\n");
|
||||
push(@redirect, "%%ENDCSV\n");
|
||||
|
|
|
@ -225,7 +225,7 @@
|
|||
# redirect redirect_host: 1=regexp,2=code,3=dest (REQUEST_URI will be appended) (generated)
|
||||
%%CSV %REDIRECT_HOST%
|
||||
if ( $host ~* "%1%" ) {
|
||||
set $dont_onionify_response_headers 1;
|
||||
set $dont_onionify_response_headers 1; # dest URL must not be rewritten, prevent loops; cookies may migrate.
|
||||
return %2% %3%$request_uri;
|
||||
}
|
||||
%%ENDCSV
|
||||
|
@ -246,7 +246,7 @@
|
|||
# fixed_redirect redirect_fixed_host: 1=regexp,2=code,3=dest (REQUEST_URI will NOT be appended) (generated)
|
||||
%%CSV %REDIRECT_FIXED_HOST%
|
||||
if ( $host ~* "%1%" ) {
|
||||
set $dont_onionify_response_headers 1;
|
||||
set $dont_onionify_response_headers 1; # dest URL must not be rewritten, prevent loops; cookies may migrate.
|
||||
return %2% %3%;
|
||||
}
|
||||
%%ENDCSV
|
||||
|
|
Ładowanie…
Reference in New Issue