Strip protocol from hostname in HTTP headers (#1486868)

release-0.6
thomascube 14 years ago
parent 2fc4596587
commit 52c0f7626c

@ -46,7 +46,7 @@ $store = "";
if ($fp = fsockopen($host, $port, $errno, $errstr, 30))
{
$out = "POST $path HTTP/1.0\r\n";
$out .= "Host: $host\r\n";
$out .= "Host: " . str_replace('ssl://', '', $host) . "\r\n";
$out .= "Content-Length: " . strlen($data) . "\r\n";
$out .= "Content-Type: application/x-www-form-urlencoded\r\n";
$out .= "Connection: Close\r\n\r\n";

@ -30,7 +30,7 @@ function googie_get($host, $port, $path, $data)
$store = '';
if ($fp = fsockopen($host, $port, $errno, $errstr, 30)) {
$out = "POST $path HTTP/1.0\r\n";
$out .= "Host: $host\r\n";
$out .= "Host: " . str_replace('ssl://', '', $host) . "\r\n";
$out .= "Content-Length: " . strlen($data) . "\r\n";
$out .= "Content-Type: application/x-www-form-urlencoded\r\n";
$out .= "Connection: Close\r\n\r\n";

Loading…
Cancel
Save