Closes #155, test for #156

Fixes #155 by disabeling the HTTP/1.1 100-Continuation mechanism (clearing the Expect-Header), which breaks with imcompatible servers for POST-requests larger than 1024B.
Added explicit content accepted encoding for #156. This should resolve the issue. However, further testing on this is required.
This commit is contained in:
Sebastian Büttner 2017-07-04 12:46:49 +02:00 committed by GitHub
parent 46e88d3e80
commit 419be435d0

View File

@ -72,6 +72,7 @@ class AsyncHttpRequest implements UsageInformationAble {
array_push($this->headers, 'Keep-Alive: ' . $keepAlive);
array_push($this->headers, 'Connection: Keep-Alive');
}
array_push($this->headers, 'Accept-Charset: utf-8');
$request = $this->newRequest($this->url, $this->timeout);
$request->getOptions()->set(CURLOPT_AUTOREFERER, true)// accept link reference
@ -88,6 +89,8 @@ class AsyncHttpRequest implements UsageInformationAble {
array_push($this->headers, 'Content-Type: ' . $this->contentType);
array_push($this->headers, 'Keep-Alive: timeout=600, max=2000');
array_push($this->headers, 'Connection: Keep-Alive');
array_push($this->headers, 'Expect:');
array_push($this->headers, 'Accept-Charset: utf-8');
//$content = str_replace(array("\r", "\n"), '', $this->content);
$content = $this->content;
@ -229,4 +232,4 @@ class AsyncHttpRequest implements UsageInformationAble {
public function setTimeout($timeout) {
$this->timeout = $timeout;
}
}
}