We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e86f044 commit 410dd69Copy full SHA for 410dd69
proxy.php
@@ -88,13 +88,22 @@
88
// Use zlib, if acceptable
89
ini_set('zlib.output_compression', $zlib ?? 'On');
90
91
-// Output headers
+// Get content and headers
92
+$content = substr($out, $info['header_size']);
93
$header = substr($out, 0, $info['header_size']);
94
+
95
+// Rename Set-Cookie header
96
$header = preg_replace('/^Set-Cookie:/im', 'X-Proxy-Set-Cookie:', $header);
97
98
+// Output headers
99
array_map('header', explode("\r\n", $header));
100
-// And finally the body
-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;
107
108
109
0 commit comments