HTTP/1.1 does allow chunked content, but our script does not support it (yet)
authorRoland Häder <roland@mxchange.org>
Sun, 28 Mar 2010 21:24:39 +0000 (21:24 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 28 Mar 2010 21:24:39 +0000 (21:24 +0000)
inc/functions.php

index b21b98e90a754a042def35c4ba88311c7c1348e9..0187e2c818180a0a5fbffee9a8e7182a6e3d7b47 100644 (file)
@@ -1782,11 +1782,9 @@ function sendGetRequest ($script, $data = array()) {
        } else {
                $request .= 'User-Agent: ' . getConfig('TITLE') . '/' . getConfig('VERSION') . getConfig('HTTP_EOL');
        }
-       $request .= 'Accept: text/plain;q=0.8' . getConfig('HTTP_EOL');
+       $request .= 'Accept: image/png,image/*;q=0.8,text/plain,text/html,*/*;q=0.5' . getConfig('HTTP_EOL');
        $request .= 'Accept-Charset: UTF-8,*' . getConfig('HTTP_EOL');
-       $request .= 'Cache-Control: no-cache' . getConfig('HTTP_EOL');
-       $request .= 'Content-Type: text/plain' . getConfig('HTTP_EOL');
-       $request .= 'Content-Length: 0' . getConfig('HTTP_EOL');
+       $request .= 'Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0' . getConfig('HTTP_EOL');
        $request .= 'Connection: close' . getConfig('HTTP_EOL');
        $request .= getConfig('HTTP_EOL');
 
@@ -1813,7 +1811,7 @@ function sendPostRequest ($script, $postData) {
        $body = http_build_query($postData, '', '&');
 
        // Generate POST request header
-       $request  = 'POST /' . trim($script) . ' HTTP/1.1' . getConfig('HTTP_EOL');
+       $request  = 'POST /' . trim($script) . ' HTTP/1.0' . getConfig('HTTP_EOL');
        $request .= 'Host: ' . $host . getConfig('HTTP_EOL');
        $request .= 'Referer: ' . getConfig('URL') . '/admin.php' . getConfig('HTTP_EOL');
        $request .= 'User-Agent: ' . getConfig('TITLE') . '/' . getConfig('FULL_VERSION') . getConfig('HTTP_EOL');
@@ -1990,7 +1988,7 @@ function setupProxyTunnel ($host, $resource) {
        $response = array('', '', '');
 
        // Generate CONNECT request header
-       $proxyTunnel  = 'CONNECT ' . $host . ':80 HTTP/1.1' . getConfig('HTTP_EOL');
+       $proxyTunnel  = 'CONNECT ' . $host . ':80 HTTP/1.0' . getConfig('HTTP_EOL');
        $proxyTunnel .= 'Host: ' . $host . getConfig('HTTP_EOL');
 
        // Use login data to proxy? (username at least!)