mirror of
https://github.com/GeoffreyFrogeye/phroxyp.git
synced 2024-11-22 19:46:03 +01:00
Fixed long POST
By using the same techique used with payload, i.e. forcing "Connection: Close"
This commit is contained in:
parent
64b2a4e09d
commit
61ca4039e7
14
proxy.php
14
proxy.php
|
@ -50,22 +50,20 @@ class Proxy {
|
|||
if ($metd == 'POST') { // TODO Other with data methods
|
||||
if (isset($_POST['payload'])) {
|
||||
$postData = stripslashes($_POST['payload']);
|
||||
$reqHeds .= "Content-Length: ".strlen($postData)."\r\n";
|
||||
$reqHeds .= "Connection: Close\r\n";
|
||||
$reqHeds .= "\r\n" . $postData;
|
||||
} else {
|
||||
$postinfo = '';
|
||||
$postData = '';
|
||||
foreach ($_POST as $key => $value) {
|
||||
$postinfo .= $key . '=' . urlencode($value) . '&';
|
||||
$postData .= $key . '=' . urlencode($value) . '&';
|
||||
}
|
||||
$postinfo = rtrim($postinfo, '&');
|
||||
$reqHeds .= "\r\n" . $postinfo;
|
||||
$postData = rtrim($postData, '&');
|
||||
}
|
||||
$reqHeds .= "Content-Length: ".strlen($postData)."\r\n";
|
||||
$reqHeds .= "Connection: Close\r\n";
|
||||
$reqHeds .= "\r\n" . $postData;
|
||||
} else {
|
||||
$reqHeds .= "Connection: Close\r\n\r\n";
|
||||
}
|
||||
|
||||
|
||||
$fp = fsockopen($serv, $port, $errno, $errstr, 30);
|
||||
if (!$fp) { // TODO ErrorCode, ErrorDocument
|
||||
echo "Couldn't connect to server\n<br/>$errstr ($errno)<br />\n";
|
||||
|
|
Loading…
Reference in a new issue