summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2011-10-06 20:12:03 +0300
committerVille Skyttä <ville.skytta@iki.fi>2011-10-06 20:15:20 +0300
commit3b4eb77b4db81920a5fdac8e55ff3fccd7aee1cf (patch)
treee0cc31248b98286bccacac5dc193c04238b3cfc7
parent343f07d0ad84159be3b02e8214dd0d2dd1e0757e (diff)
downloadvdradmin-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--HISTORY1
-rwxr-xr-xvdradmind.pl5
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);