Skip to content

Commit

Permalink
Merge 241698a into 0afe0a9
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Dec 13, 2019
2 parents 0afe0a9 + 241698a commit 5cdb459
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Connection/Internal/RequestNormalizer.php
Expand Up @@ -63,7 +63,7 @@ private static function normalizeRequestBodyHeaders(Request $request): \Generato
$bodyLength = yield $body->getBodyLength();

if ($bodyLength === 0) {
if (!\in_array($request->getMethod(), ['HEAD', 'GET', 'CONNECT'], true)) {
if (!\in_array($request->getMethod(), ['HEAD', 'GET', 'CONNECT'], true) || $request->hasHeader('upgrade')) {
$request->removeHeader('content-length');
} else {
$request->setHeader('content-length', '0');
Expand Down

0 comments on commit 5cdb459

Please sign in to comment.