1
# vim:set ft= ts=4 sw=4 et fdm=marker:
4
use Test::Nginx::Socket;
6
#worker_connections(1014);
7
#master_process_enabled(1);
13
plan tests => blocks() * repeat_each() * 3;
22
=== TEST 1: set response content-type header
26
ngx.header.content_type = "text/my-plain";
33
Content-Type: text/my-plain
39
=== TEST 2: set response content-type header
43
ngx.header.content_length = "text/my-plain";
49
--- response_body_like: 500 Internal Server Error
51
Content-Type: text/html
56
=== TEST 3: set response content-type header
60
ngx.header.content_length = 3
73
=== TEST 4: set response content-type header
78
ngx.header["Location"] = "http://www.taobao.com/foo";
84
Location: http://www.taobao.com/foo
90
=== TEST 5: set response content-type header
94
ngx.header.content_length = 3
95
ngx.header.content_length = nil
108
=== TEST 6: set multi response content-type header
112
ngx.header["X-Foo"] = {"a", "bc"}
118
--- raw_response_headers_like chomp
119
X-Foo: a\r\n.*?X-Foo: bc$
125
=== TEST 7: set response content-type header
129
ngx.header.content_type = {"a", "bc"}
142
=== TEST 8: set multi response content-type header and clears it
146
ngx.header["X-Foo"] = {"a", "bc"}
147
ngx.header["X-Foo"] = {}
160
=== TEST 9: set multi response content-type header and clears it
164
ngx.header["X-Foo"] = {"a", "bc"}
165
ngx.header["X-Foo"] = nil
178
=== TEST 10: set multi response content-type header (multiple times)
182
ngx.header["X-Foo"] = {"a", "bc"}
183
ngx.header["X-Foo"] = {"a", "abc"}
189
--- raw_response_headers_like chomp
190
X-Foo: a\r\n.*?X-Foo: abc$