old-openresty
old-openresty copied to clipboard
echo_subrequest adds http headers
When changing:
echo_foreach_split ',' $filelist; echo_subrequest_async GET '/getFile' -q 'file=$echo_it' ; echo_end;
to
echo_foreach_split ',' $filelist; echo_subrequest GET '/getFile' -q 'file=$echo_it' ; echo_end;
the body is modified, and I see some http headers added:
@HTTP/1.1 200 OK^M Server: ngx_openresty^M Date: Wed, 02 May 2012 10:25:06 GMT^M Content-Type: text/plain^M Transfer-Encoding: chunked^M Connection: close^M
Yes, the chunked encoding is enforced when subrequests are used this way. Because ngx_echo cannot know the total response body size beforehand. Also, you should adjust the Content-Type and other headers accordingly because subrequests' response headers will not be forwarded to the parent request.
BTW, please do not report issues regarding the ngx_openresty project (https://github.com/agentzh/ngx_openresty ) to the old Perl implementation of the OpenResty server. Report to the ngx_openresty github project instead. Thank you!
On 02/mai - 06:15, agentzh (章亦春) wrote:
Yes, the chunked encoding is enforced when subrequests are used this way. Because ngx_echo cannot know the total response body size beforehand. Also, you should adjust the Content-Type and other headers accordingly because subrequests' response headers will not be forwarded to the parent request.
BTW, please do not report issues regarding the ngx_openresty project (https://github.com/agentzh/ngx_openresty ) to the old Perl implementation of the OpenResty server. Report to the ngx_openresty github project instead. Thank you! sorry about that, I will :)
Reply to this email directly or view it on GitHub: https://github.com/agentzh/openresty/issues/1#issuecomment-5461048