~ubuntu-branches/ubuntu/quantal/nginx/quantal-updates

« back to all changes in this revision

Viewing changes to debian/modules/nginx-lua/t/016-headers.t

  • Committer: Bazaar Package Importer
  • Author(s): Michael Lustfield, Micheal Lustfield, Kartik Mistry
  • Date: 2011-03-03 23:39:07 UTC
  • mfrom: (4.2.29 sid)
  • Revision ID: james.westby@ubuntu.com-20110303233907-y48yifhfnn5qjuxz
Tags: 0.8.54-4
[Micheal Lustfield]
* debian/nginx-{full,light,extras}.default:
  + Added comment about alternative to ULIMIT.
* debian/nginx-{full,light,extras}.init.d:
  + Added quotes around a test variable. (Closes: #610946, LP: #699736)
* debian/patches/609343-log-time-iso8601.diff:
  + Added patch to add $time_iso8601 variable to logs. (Closes: #609343)
* Clean up old logrotate files. (Closes: #608983, Closes: #610289)
  + Added Files:
    - debian/nginx-common.preinst
  + Modified Files:
    - debian/rules
  + Moved debian/nginx-common.logrotate to debian/logrotate.
* Added common files to nginx-common package. (Closes: #610290)
  + Removed Files:
    - debian/nginx-full.dirs
    - debian/nginx-light.dirs
    - debian/nginx-full.install
    - debian/nginx-light.install
    - debian/nginx-extras.install
    - debian/nginx.*
  + Added Files:
    - debian/nginx-common.default
    - debian/nginx-common.dirs
    - debian/nginx-common.init.d
    - debian/nginx-common.install
    - debian/nginx-common.manpages
    - debian/logrotate
  + Modified Files:
    - debian/nginx-extras.dirs
    - debian/control
    - debian/rules
* debian/nginx-*.install: (Closes: #609797)
  + Removed NEWS.Debian from nginx-{full,light,extras}.install.
  + Added NEWS.Debian to nginx-common.install.
* nginx-common.postinst:
  + Enforce /var/log/nginx mode and user:group. (Closes: #610983)
  + Enforce /var/log/nginx/*.log mode and user:group. (Closes: #612832)
* debian/rules:
  + Added --with-file-aio to nginx-extras. (Closes: #613175)
  + Removed split clients and user id modules from nginx-light.
* debian/conf/sites-available/default:
  + Fixed a minor typo ( s/Quickstart/QuickStart/ ). (Closes: #613355)
* debian/conf/mime.types:
  + Changed xml type to application/xhtml+xml. (Closes: #613851)
* debian/help/docs/fcgiwrap:
  + Removed Ubuntu specific line in docs. (Closes: #614987)
* debian/conf/sites-available/default:
  + Fixed a pointer to a file. (Closes: #614980)

[Kartik Mistry]
* debian/*.lintian-overrides:
  + Add Lintian overrides for nginx man page. We've manpage in nginx-common
    binary

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# vim:set ft= ts=4 sw=4 et fdm=marker:
 
2
 
 
3
use lib 'lib';
 
4
use Test::Nginx::Socket;
 
5
 
 
6
#worker_connections(1014);
 
7
#master_process_enabled(1);
 
8
#log_level('warn');
 
9
 
 
10
repeat_each(2);
 
11
#repeat_each(1);
 
12
 
 
13
plan tests => blocks() * repeat_each() * 3;
 
14
 
 
15
#no_diff();
 
16
#no_long_string();
 
17
 
 
18
run_tests();
 
19
 
 
20
__DATA__
 
21
 
 
22
=== TEST 1: set response content-type header
 
23
--- config
 
24
    location /read {
 
25
        content_by_lua '
 
26
            ngx.header.content_type = "text/my-plain";
 
27
            ngx.say("Hi");
 
28
        ';
 
29
    }
 
30
--- request
 
31
GET /read
 
32
--- response_headers
 
33
Content-Type: text/my-plain
 
34
--- response_body
 
35
Hi
 
36
 
 
37
 
 
38
 
 
39
=== TEST 2: set response content-type header
 
40
--- config
 
41
    location /read {
 
42
        content_by_lua '
 
43
            ngx.header.content_length = "text/my-plain";
 
44
            ngx.say("Hi");
 
45
        ';
 
46
    }
 
47
--- request
 
48
GET /read
 
49
--- response_body_like: 500 Internal Server Error
 
50
--- response_headers
 
51
Content-Type: text/html
 
52
--- error_code: 500
 
53
 
 
54
 
 
55
 
 
56
=== TEST 3: set response content-type header
 
57
--- config
 
58
    location /read {
 
59
        content_by_lua '
 
60
            ngx.header.content_length = 3
 
61
            ngx.say("Hello")
 
62
        ';
 
63
    }
 
64
--- request
 
65
GET /read
 
66
--- response_headers
 
67
Content-Length: 3
 
68
--- response_body
 
69
Hello
 
70
 
 
71
 
 
72
 
 
73
=== TEST 4: set response content-type header
 
74
--- config
 
75
    location /read {
 
76
        content_by_lua '
 
77
            ngx.status = 302;
 
78
            ngx.header["Location"] = "http://www.taobao.com/foo";
 
79
        ';
 
80
    }
 
81
--- request
 
82
GET /read
 
83
--- response_headers
 
84
Location: http://www.taobao.com/foo
 
85
--- response_body
 
86
--- error_code: 302
 
87
 
 
88
 
 
89
 
 
90
=== TEST 5: set response content-type header
 
91
--- config
 
92
    location /read {
 
93
        content_by_lua '
 
94
            ngx.header.content_length = 3
 
95
            ngx.header.content_length = nil
 
96
            ngx.say("Hello")
 
97
        ';
 
98
    }
 
99
--- request
 
100
GET /read
 
101
--- response_headers
 
102
!Content-Length
 
103
--- response_body
 
104
Hello
 
105
 
 
106
 
 
107
 
 
108
=== TEST 6: set multi response content-type header
 
109
--- config
 
110
    location /read {
 
111
        content_by_lua '
 
112
            ngx.header["X-Foo"] = {"a", "bc"}
 
113
            ngx.say("Hello")
 
114
        ';
 
115
    }
 
116
--- request
 
117
GET /read
 
118
--- raw_response_headers_like chomp
 
119
X-Foo: a\r\n.*?X-Foo: bc$
 
120
--- response_body
 
121
Hello
 
122
 
 
123
 
 
124
 
 
125
=== TEST 7: set response content-type header
 
126
--- config
 
127
    location /read {
 
128
        content_by_lua '
 
129
            ngx.header.content_type = {"a", "bc"}
 
130
            ngx.say("Hello")
 
131
        ';
 
132
    }
 
133
--- request
 
134
GET /read
 
135
--- response_headers
 
136
Content-Type: bc
 
137
--- response_body
 
138
Hello
 
139
 
 
140
 
 
141
 
 
142
=== TEST 8: set multi response content-type header and clears it
 
143
--- config
 
144
    location /read {
 
145
        content_by_lua '
 
146
            ngx.header["X-Foo"] = {"a", "bc"}
 
147
            ngx.header["X-Foo"] = {}
 
148
            ngx.say("Hello")
 
149
        ';
 
150
    }
 
151
--- request
 
152
GET /read
 
153
--- response_headers
 
154
!X-Foo
 
155
--- response_body
 
156
Hello
 
157
 
 
158
 
 
159
 
 
160
=== TEST 9: set multi response content-type header and clears it
 
161
--- config
 
162
    location /read {
 
163
        content_by_lua '
 
164
            ngx.header["X-Foo"] = {"a", "bc"}
 
165
            ngx.header["X-Foo"] = nil
 
166
            ngx.say("Hello")
 
167
        ';
 
168
    }
 
169
--- request
 
170
GET /read
 
171
--- response_headers
 
172
!X-Foo
 
173
--- response_body
 
174
Hello
 
175
 
 
176
 
 
177
 
 
178
=== TEST 10: set multi response content-type header (multiple times)
 
179
--- config
 
180
    location /read {
 
181
        content_by_lua '
 
182
            ngx.header["X-Foo"] = {"a", "bc"}
 
183
            ngx.header["X-Foo"] = {"a", "abc"}
 
184
            ngx.say("Hello")
 
185
        ';
 
186
    }
 
187
--- request
 
188
GET /read
 
189
--- raw_response_headers_like chomp
 
190
X-Foo: a\r\n.*?X-Foo: abc$
 
191
--- response_body
 
192
Hello
 
193