From 3b4eb77b4db81920a5fdac8e55ff3fccd7aee1cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 6 Oct 2011 20:12:03 +0300 Subject: 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. --- HISTORY | 1 + vdradmind.pl | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/HISTORY b/HISTORY index 92e12f0..c909453 100644 --- a/HISTORY +++ b/HISTORY @@ -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); -- cgit v1.2.3