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 88
88
// Use zlib, if acceptable
89
89
ini_set ('zlib.output_compression ' , $ zlib ?? 'On ' );
90
90
91
- // Output headers
91
+ // Get content and headers
92
+ $ content = substr ($ out , $ info ['header_size ' ]);
92
93
$ header = substr ($ out , 0 , $ info ['header_size ' ]);
94
+
95
+ // Rename Set-Cookie header
93
96
$ header = preg_replace ('/^Set-Cookie:/im ' , 'X-Proxy-Set-Cookie: ' , $ header );
97
+
98
+ // Output headers
94
99
array_map ('header ' , explode ("\r\n" , $ header ));
95
100
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 ;
98
107
99
108
100
109
You can’t perform that action at this time.
0 commit comments