Skip to content

Commit de652cc

Browse files
committed
HeaderRewritePlugin: do not send content-length header
1 parent 4f79002 commit de652cc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Plugin/HeaderRewritePlugin.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ function onHeadersReceived(ProxyEvent $event){
3939
}
4040

4141
// we need content-encoding (in case server refuses to serve it in plain text)
42-
$forward_headers = array('content-type', 'content-length', 'accept-ranges', 'content-range', 'content-disposition', 'location', 'set-cookie');
42+
// content-length: final size of content sent to user may change via plugins, so it makes no sense to send old content-length
43+
$forward_headers = array('content-type', 'zzzcontent-length', 'accept-ranges', 'content-range', 'content-disposition', 'location', 'set-cookie');
4344

4445
foreach($response->headers->all() as $name => $value){
4546

0 commit comments

Comments
 (0)