Fix Path: header parsing.
Signed-off-by: Thomas Hochstein <thh@thh.name>
This commit is contained in:
parent
f6b7a1d000
commit
f7485561dd
|
@ -301,16 +301,16 @@ sub HostStats {
|
||||||
if (!$Host) {
|
if (!$Host) {
|
||||||
if ($Header{'path'} =~ /!([^!]+)!.POSTED!/) {
|
if ($Header{'path'} =~ /!([^!]+)!.POSTED!/) {
|
||||||
$Host = "$1";
|
$Host = "$1";
|
||||||
} elsif ($Header{'path'} =~ /!.POSTED.([^!]+)!/) {
|
} elsif ($Header{'path'} =~ /([^!]+)!.POSTED.[^!]+!?/) {
|
||||||
$Host = "$1";
|
$Host = "$1";
|
||||||
} else {
|
} else {
|
||||||
# iterate on the Path: header until we have a host name or no more
|
# iterate on the Path: header until we have a host name or no more
|
||||||
# path elements
|
# path elements
|
||||||
while (!$Host && $Header{'path'} =~ /!/) {
|
while (!$Host && $Header{'path'} =~ /!/) {
|
||||||
($Host) = $Header{'path'} =~ /!?([a-z0-9-_]+\.[a-z0-9-_.]+)![^!]+$/i;
|
($Host) = $Header{'path'} =~ /!?([a-z0-9-_]+\.[a-z0-9-_.]+)!!?[^!]+!?$/i;
|
||||||
undef($Host) if $Host && $Host =~ /\.MISMATCH/;
|
undef($Host) if $Host && $Host =~ /\.MISMATCH/;
|
||||||
# remove last path element
|
# remove last path element
|
||||||
$Header{'path'} =~ s/![^!]+$//;
|
$Header{'path'} =~ s/!!?[^!]+$//;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue