File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 8888// Use zlib, if acceptable
8989ini_set ('zlib.output_compression ' , $ zlib ?? 'On ' );
9090
91- // Output headers
91+ // Get content and headers
92+ $ content = substr ($ out , $ info ['header_size ' ]);
9293$ header = substr ($ out , 0 , $ info ['header_size ' ]);
94+
95+ // Rename Set-Cookie header
9396$ header = preg_replace ('/^Set-Cookie:/im ' , 'X-Proxy-Set-Cookie: ' , $ header );
97+
98+ // Output headers
9499array_map ('header ' , explode ("\r\n" , $ header ));
95100
96- // And finally the body
97- echo substr ($ out , $ info ['header_size ' ]);
101+ // HACK: Prevent chunked encoding and gz issues (Issue #1)
102+ header_remove ('Transfer-Encoding ' );
103+ header ('Content-Length: ' .strlen ($ content ), true );
104+
105+ // Output content
106+ echo $ content ;
98107
99108
100109
You can’t perform that action at this time.
0 commit comments