diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2011-10-06 20:12:03 +0300 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2011-10-06 20:15:20 +0300 |
commit | 3b4eb77b4db81920a5fdac8e55ff3fccd7aee1cf (patch) | |
tree | e0cc31248b98286bccacac5dc193c04238b3cfc7 | |
parent | 343f07d0ad84159be3b02e8214dd0d2dd1e0757e (diff) | |
download | vdradmin-am-3b4eb77b4db81920a5fdac8e55ff3fccd7aee1cf.tar.gz vdradmin-am-3b4eb77b4db81920a5fdac8e55ff3fccd7aee1cf.tar.bz2 |
Initialize $ENV{HTTP_HOST} from Host: to fix CGI->url() (closes #653).
While at it, make it local so it does not stick between requests.
-rw-r--r-- | HISTORY | 1 | ||||
-rwxr-xr-x | vdradmind.pl | 5 |
2 files changed, 4 insertions, 2 deletions
@@ -13,6 +13,7 @@ VDR-Portal: amair - Changed: Specifying -L or -l turns logging on (Ville Skyttä). - Improved: Do not require pid dir when not running as daemon (Ville Skyttä). - Improved: Autodetect default for number of DVB cards (Ville Skyttä). +- Fixed: Non-localhost streamdev URL (Bug report #653, Ville Skyttä). 2011-06-03: 3.6.8 - Updated: Dutch translation (Submitted by Roel Koelewijn). diff --git a/vdradmind.pl b/vdradmind.pl index 625912a..0340b1a 100755 --- a/vdradmind.pl +++ b/vdradmind.pl @@ -301,7 +301,7 @@ $UserCSS = "user.css" if (-e "$USER_CSS"); my $USE_SHELL_GZIP = false; # set on false to use the gzip library -my (%EPG, %CHAN, $q, $ACCEPT_GZIP, $SVDRP, $HOST, $low_time, @RECORDINGS); +my (%EPG, %CHAN, $q, $ACCEPT_GZIP, $SVDRP, $low_time, @RECORDINGS); my (%mimehash) = (html => "text/html", png => "image/png", gif => "image/gif", @@ -671,6 +671,7 @@ while (true) { } $Request =~ s/^\/\/*/\//; + local $ENV{HTTP_HOST}; # parse header my ($username, $password, $http_useragent); @@ -681,7 +682,7 @@ while (true) { $Referer = $1; } if ($line =~ /Host: (.*)/) { - $HOST = $1; + $ENV{HTTP_HOST} = $1; } if ($line =~ /Authorization: basic (.*)/i) { ($username, $password) = split(":", MIME::Base64::decode_base64($1), 2); |