Ticket #3990: apache_mod_proxy.3.patch
File apache_mod_proxy.3.patch, 3.5 KB (added by , 13 years ago) |
---|
-
mythweb/includes/utils.php
330 330 if (!$ext && $_SESSION['file_url_override']) 331 331 return 'file://'.$_SESSION['file_url_override'].str_replace('%2F', '/', rawurlencode(basename($show->filename))); 332 332 // Which protocol should we use for downloads? 333 333 334 $url = (($_SESSION['stream']['force_http'] || !isset($_SERVER['HTTPS'])) 334 ? 'http://' . $_SERVER['HTTP_HOST'].':'._or($_SESSION['stream']['force_http_port'], '80')335 : 'https://'. $_SERVER['HTTP_HOST'].':'._or($_SESSION['stream']['force_http_port'], '443')335 ? 'http://' . http_host .':'._or($_SESSION['stream']['force_http_port'], '80') 336 : 'https://'. http_host .':'._or($_SESSION['stream']['force_http_port'], '443') 336 337 ) 337 338 .root."pl/stream/$show->chanid/$show->recstartts"; 338 339 // Handle specific file extension modes … … 350 351 // Windows likely gets a myth:// url -- grab the master host and port 351 352 global $Master_Host, $Master_Port; 352 353 // Is either the browser xor the master in an rfc 1918 zone? 354 $remoteaddr = $_SERVER['REMOTE_ADDR']; 355 if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) 356 $remoteaddr = $_SERVER['HTTP_X_FORWARDED_FOR']; 353 357 if (preg_match('/^(?:10|192\.168|172\.(?:1[6-9]|2[0-9]|3[0-6]))\./', $Master_Host) 354 xor preg_match('/^(?:10|192\.168|172\.(?:1[6-9]|2[0-9]|3[0-6]))\./', $ _SERVER['REMOTE_ADDR'])) {358 xor preg_match('/^(?:10|192\.168|172\.(?:1[6-9]|2[0-9]|3[0-6]))\./', $remoteaddr)) { 355 359 return $url; 356 360 } 357 361 // Send the myth url -
mythweb/includes/defines.php
64 64 define('mb', 1024 * kb); // Megabyte 65 65 define('gb', 1024 * mb); // Gigabyte 66 66 define('tb', 1024 * gb); // Terabyte 67 68 // Define the http host used for access 69 70 define('http_host', isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST']); 71 -
mythweb/modules/music/handler.php
45 45 $protocol = "http://"; 46 46 if (!$_SESSION['stream']['force_http'] && isset($_SERVER['HTTPS'])) 47 47 $protocol = "https://"; 48 return $protocol. $_SERVER["HTTP_HOST"].root.'music/';48 return $protocol. http_host .root.'music/'; 49 49 } 50 50 -
mythweb/modules/stream/handler.pl
91 91 my $uri = ($ENV{'HTTPS'} || $ENV{'SERVER_PORT'} == 443) 92 92 ? 'https' 93 93 : 'http'; 94 $uri .= '://'.($ENV{'SERVER_NAME'} or $ENV{'SERVER_ADDR'}).':'.$ENV{'SERVER_PORT'} 94 my $serverAddr = $ENV{'HTTP_X_FORWARDED_HOST'} || $ENV{'SERVER_NAME'} || $ENV{'SERVER_ADDR'}; 95 $uri .= '://'.$serverAddr.':'.$ENV{'SERVER_PORT'} 95 96 .$ENV{'REQUEST_URI'}; 97 96 98 $uri =~ s/\.asx$//i; 97 99 # Build the ASX file so we can know how long it is 98 100 my $file = <<EOF;