Hello!
On Fri, Feb 20, 2015 at 1:53 AM, Kipras Mancevičius wrote:
> first of all sorry if this is not the right place to post questions
> regarding the Test::Nginx::Socket test suite, but i could not find a
> dedicated forum for it, please point in the right direction, if one exists
> :)
It's fine to post such questions here :)
> In my test case i need to send several requests with custom (and different)
> Host headers (not “localhost”, which is sent by default, when using the
> “request” section).
You can use the --- more_headers and --- pipelined_requests for this:
=== TEST 1: custom Host request header
--- ONLY
--- config
location = /t {
echo -n $echo_client_request_headers;
}
--- pipelined_requests eval
["GET /t", "GET /t"]
--- more_headers eval
["Host: abc.com", "Host: foo.com"]
--- response_body eval
["GET /t HTTP/1.1\r
Connection: keep-alive\r
Host: abc.com\r
\r
",
"GET /t HTTP/1.1\r
Connection: close\r
Host: foo.com\r
\r
"]
--- no_error_log
[error]
Use of --- request in place of --- pipelined_requests should work too
but there is a small bug in Test::Nginx::Socket which I'd fix shortly.
Best regards,
-agentzh