Skip to content

Commit

Permalink
#277 - Do not send Content-Length if streaming
Browse files Browse the repository at this point in the history
  • Loading branch information
johanjanssens committed Nov 10, 2021
1 parent ddae97b commit 4fa6e4b
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ public function send(KDispatcherResponseInterface $response)
$response->setContentType('application/octet-stream');
}

//Add Content-Length if not present
if(!$response->headers->has('Content-Length')) {
//Add Content-Length if not present and not streaming
if(!$response->headers->has('Content-Length') && !$request->isStreaming()) {
$response->headers->set('Content-Length', $response->getStream()->getSize());
}
}
Expand Down Expand Up @@ -239,3 +239,4 @@ public function send(KDispatcherResponseInterface $response)
return parent::send($response);
}
}

0 comments on commit 4fa6e4b

Please sign in to comment.