Skip to content

Commit 67b0d7d

Browse files
committed
Rewrite Set-Cookie in responses to X-Proxy-Set-Cookie
1 parent 85e6240 commit 67b0d7d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

proxy.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090

9191
// Output headers
9292
$header = substr($out, 0, $info['header_size']);
93+
$header = preg_replace('/^Set-Cookie:/im', 'X-Proxy-Set-Cookie:', $header);
9394
array_map('header', explode("\r\n", $header));
9495

9596
// And finally the body

test/echo.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@
1111
header_remove();
1212
ob_start('ob_gzhandler');
1313
header('Content-Type: application/json; charset=utf-8');
14-
header('X-TestHeader: This header should come back through');
14+
header('X-Test-Header: This header should come back through');
15+
setcookie('Test-Cookie', uniqid());
16+
1517
echo json_encode($info, JSON_PRETTY_PRINT | JSON_NUMERIC_CHECK | JSON_FORCE_OBJECT);

0 commit comments

Comments
 (0)