-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
ok, first - don't try to find a sense in this code - but it does not behave as it is expected:
i have a php-script which is used via fastcgi in nginx and will only execute this:
<?php
setcookie("TestCookie1", "foo");
setcookie("TestCookie2", "bar");
phpinfo();
?>When using rewrite_by_lua_file with this code something unexpected happens:
if ngx.is_subrequest == false then
ngx.header["Set-Cookie"] = {}
res = ngx.location.capture(ngx.var.uri)
for i,j in pairs(res.header) do ngx.header[i] = j end
ngx.send_headers()
ngx.print(res.body)
endNormally i thought that the "for .. pairs"-part will write all response-headers from the subrequest into the ngx.header-table again. but in the Set-Cookie header only "TestCookie2" is received by the client which starts the request...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels