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

« back to all changes in this revision

Viewing changes to debian/modules/chunkin-nginx-module/t/bug.t

  • Committer: Package Import Robot
  • Author(s): Kartik Mistry, Kartik Mistry, Michael Lustfield
  • Date: 2011-11-18 23:44:00 UTC
  • mfrom: (4.2.39 sid)
  • Revision ID: package-import@ubuntu.com-20111118234400-atj8d0zog78vgdte
Tags: 1.1.8-1
[Kartik Mistry]
* New upstream release.
* debian/modules/chunkin-nginx-module:
  + Removed as of now, as it breaks with Perl 5.14 (Closes: #649061)

[Michael Lustfield]
* debian/control:
  + Added Map module to nginx-light modules list.
* debian/rules:
  + Removed --without-http_map_module form nginx-light.
* debian/nginx-common.install:
  + Changed ufw profile installation (LP: #825349).
    - debian/ufw.profile -> debian/ufw/nginx.
* debian/nginx-common.preinst:
  + Cleanup of moved nginx profile.
* debian/conf/nginx.conf:
  + Added a default map for $server_https (on|off).
* debian/conf/fastcgi_params:
  + Pass HTTPS so $_SERVER['HTTPS'] is set (LP: #857831).
* debian/conf/mime.types:
  + Added json type (LP: #883440).
* debian/conf/sites-available/default:
  + Added notes about PHP (Closes: #642995).
  + Changed location /doc from root to alias.
  + Changed location /doc to /doc/ for people that don't bother reading or
    learning anything about Nginx configuration files (LP: #840358).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# vi:filetype=
2
 
 
3
 
use lib 't/lib';
4
 
use Test::Nginx::Socket::Chunkin;
5
 
 
6
 
repeat_each(3);
7
 
#warn 'repeat each: ', repeat_each, "\n";
8
 
 
9
 
plan tests => repeat_each() * 2 * blocks();
10
 
 
11
 
no_diff;
12
 
 
13
 
run_tests();
14
 
 
15
 
__DATA__
16
 
 
17
 
=== TEST 1: binary in data
18
 
--- config
19
 
    chunkin on;
20
 
    location /ar.do {
21
 
        echo_request_body;
22
 
    }
23
 
--- more_headers
24
 
Transfer-Encoding: chunked
25
 
--- request eval
26
 
"POST /ar.do
27
 
1b9\r
28
 
".'%Q`3�BBT0123456789AF%Q_�k%Q_�kwtk-emulatorSunMicrosystems_wtk AX7`encoding=pcm encoding=pcm&rate=8000&bits=8&channels=1 encoding=pcm&rate=22050&bits=16&chanZach-Laptop-W1.01.0en-US1.01.11.11.0SunMicrosystems_wtMIDP-2.11.0.10H,1Haudio/x-wavtruetruetruetruenencoding=rgb565&width=160&height=120 encoding=rgb565&width=320&height=240 encoding=rgb565&width=120&height=160encoding=jpeg encoding=png+12345678900http://mmsc.127.0.0.01'."\r
29
 
0\r
30
 
\r
31
 
"
32
 
--- response_body eval
33
 
'%Q`3�BBT0123456789AF%Q_�k%Q_�kwtk-emulatorSunMicrosystems_wtk AX7`encoding=pcm encoding=pcm&rate=8000&bits=8&channels=1 encoding=pcm&rate=22050&bits=16&chanZach-Laptop-W1.01.0en-US1.01.11.11.0SunMicrosystems_wtMIDP-2.11.0.10H,1Haudio/x-wavtruetruetruetruenencoding=rgb565&width=160&height=120 encoding=rgb565&width=320&height=240 encoding=rgb565&width=120&height=160encoding=jpeg encoding=png+12345678900http://mmsc.127.0.0.01'
34
 
 
35
 
 
36
 
 
37
 
=== TEST 2: CRLF in data (missing trailing CRLF)
38
 
--- config
39
 
    chunkin on;
40
 
    location /ar.do {
41
 
        echo_request_body;
42
 
    }
43
 
--- more_headers
44
 
Transfer-Encoding: chunked
45
 
--- request eval
46
 
"POST /ar.do
47
 
2\r
48
 
\r
49
 
0\r
50
 
\r
51
 
"
52
 
--- response_body_like: 400 Bad Request
53
 
--- error_code: 400
54
 
 
55
 
 
56
 
 
57
 
=== TEST 3: CRLF in data
58
 
--- config
59
 
    chunkin on;
60
 
    location /ar.do {
61
 
        echo_request_body;
62
 
    }
63
 
--- more_headers
64
 
Transfer-Encoding: chunked
65
 
--- request eval
66
 
"POST /ar.do
67
 
2\r
68
 
\r
69
 
\r
70
 
0\r
71
 
\r
72
 
"
73
 
--- response_body eval
74
 
"\r\n"
75
 
 
76
 
 
77
 
 
78
 
=== TEST 4: leading CRLF in data
79
 
--- config
80
 
    chunkin on;
81
 
    location /ar.do {
82
 
        echo_request_body;
83
 
    }
84
 
--- more_headers
85
 
Transfer-Encoding: chunked
86
 
--- request eval
87
 
"POST /ar.do
88
 
4\r
89
 
\r
90
 
ab\r
91
 
0\r
92
 
\r
93
 
"
94
 
--- response_body eval
95
 
"\r\nab"
96
 
 
97
 
 
98
 
 
99
 
=== TEST 5: trailing CRLF in data
100
 
--- config
101
 
    chunkin on;
102
 
    location /ar.do {
103
 
        echo_request_body;
104
 
    }
105
 
--- more_headers
106
 
Transfer-Encoding: chunked
107
 
--- request eval
108
 
"POST /ar.do
109
 
4\r
110
 
ab\r
111
 
\r
112
 
0\r
113
 
\r
114
 
"
115
 
--- response_body eval
116
 
"ab\r\n"
117
 
 
118
 
 
119
 
 
120
 
=== TEST 6: embedded CRLF in data
121
 
--- config
122
 
    chunkin on;
123
 
    location /ar.do {
124
 
        echo_request_body;
125
 
    }
126
 
--- more_headers
127
 
Transfer-Encoding: chunked
128
 
--- request eval
129
 
"POST /ar.do
130
 
6\r
131
 
ab\r
132
 
cd\r
133
 
0\r
134
 
\r
135
 
"
136
 
--- response_body eval
137
 
"ab\r\ncd"
138
 
 
139
 
 
140
 
 
141
 
=== TEST 7: 413 in proxy
142
 
--- config
143
 
    chunkin on;
144
 
    location /main {
145
 
        proxy_pass $scheme://127.0.0.1:$server_port/proxy;
146
 
    }
147
 
    location /proxy {
148
 
        return 411;
149
 
    }
150
 
--- more_headers
151
 
Transfer-Encoding: chunked
152
 
--- request eval
153
 
"POST /main
154
 
2\r
155
 
ab\r
156
 
0\r
157
 
\r
158
 
"
159
 
--- response_body_like: 411 Length Required
160
 
--- error_code: 411
161
 
 
162
 
 
163
 
 
164
 
=== TEST 8: padding spaces
165
 
--- config
166
 
    chunkin on;
167
 
    location /ar.do {
168
 
        echo_request_body;
169
 
    }
170
 
--- more_headers
171
 
Transfer-Encoding: chunked
172
 
--- request eval
173
 
"POST /ar.do
174
 
6  \r
175
 
ab\r
176
 
cd\r
177
 
0\r
178
 
\r
179
 
"
180
 
--- response_body eval
181
 
"ab\r\ncd"
182
 
 
183
 
 
184
 
 
185
 
=== TEST 9: padding spaces (using HT)
186
 
--- config
187
 
    chunkin on;
188
 
    location /ar.do {
189
 
        echo_request_body;
190
 
    }
191
 
--- more_headers
192
 
Transfer-Encoding: chunked
193
 
--- request eval
194
 
"POST /ar.do
195
 
6  \t\r
196
 
ab\r
197
 
cd\r
198
 
0\r
199
 
\r
200
 
"
201
 
--- response_body eval
202
 
"ab\r\ncd"
203
 
 
204
 
 
205
 
 
206
 
=== TEST 10: padding spaces (using \t and ' ' in last chunk)
207
 
--- config
208
 
    chunkin on;
209
 
    location /ar.do {
210
 
        echo_request_body;
211
 
    }
212
 
--- more_headers
213
 
Transfer-Encoding: chunked
214
 
--- request eval
215
 
"POST /ar.do
216
 
6  \t\r
217
 
ab\r
218
 
cd\r
219
 
0\t \r
220
 
\r
221
 
"
222
 
--- response_body eval
223
 
"ab\r\ncd"
224
 
 
225
 
 
226
 
 
227
 
=== TEST 11: padding LWS (using \t and ' '  with a leading CRLF in last chunk)
228
 
--- config
229
 
    chunkin on;
230
 
    location /ar.do {
231
 
        echo_request_body;
232
 
    }
233
 
--- more_headers
234
 
Transfer-Encoding: chunked
235
 
--- request eval
236
 
"POST /ar.do
237
 
6\r
238
 
\r
239
 
\t\r
240
 
ab\r
241
 
cd\r
242
 
0\t\r
243
 
\r
244
 
\r
245
 
\r
246
 
"
247
 
--- response_body_like: 400 Bad Request
248
 
--- error_code: 400
249
 
 
250
 
 
251
 
 
252
 
=== TEST 12: leading CRLF
253
 
--- config
254
 
    chunkin on;
255
 
    location /ar.do {
256
 
        echo_request_body;
257
 
    }
258
 
--- more_headers
259
 
Transfer-Encoding: chunked
260
 
--- request eval
261
 
"POST /ar.do
262
 
\r
263
 
6\r
264
 
ab\r
265
 
cd\r
266
 
0\r
267
 
\r
268
 
"
269
 
--- response_body_like: 400 Bad Request
270
 
--- error_code: 400
271
 
 
272
 
 
273
 
 
274
 
=== TEST 13: zero-padding
275
 
--- config
276
 
    chunkin on;
277
 
    location /ar.do {
278
 
        echo_request_body;
279
 
    }
280
 
--- more_headers
281
 
Transfer-Encoding: chunked
282
 
--- request eval
283
 
"POST /ar.do
284
 
0006\r
285
 
ab\r
286
 
cd\r
287
 
0\r
288
 
\r
289
 
"
290
 
--- response_body eval
291
 
"ab\r\ncd"
292
 
 
293
 
 
294
 
 
295
 
=== TEST 14: leading new lines
296
 
--- config
297
 
    chunkin on;
298
 
    location /ar.do {
299
 
        echo_request_body;
300
 
    }
301
 
--- more_headers
302
 
Transfer-Encoding: chunked
303
 
--- request eval
304
 
"POST /ar.do
305
 
\n \11\r
306
 
0006\r
307
 
ab\r
308
 
cd\r
309
 
0\r
310
 
\r
311
 
"
312
 
--- response_body_like: 400 Bad Request
313
 
--- error_code: 400
314
 
 
315
 
 
316
 
 
317
 
=== TEST 15: internal guard
318
 
--- config
319
 
    chunkin on;
320
 
    location /ar.do {
321
 
        internal;
322
 
        echo_request_body;
323
 
    }
324
 
--- more_headers
325
 
Transfer-Encoding: chunked
326
 
--- request eval
327
 
"POST /ar.do
328
 
\n \11\r
329
 
0006\r
330
 
ab\r
331
 
cd\r
332
 
0\r
333
 
\r
334
 
"
335
 
--- response_body_like: 404 Not Found
336
 
--- error_code: 404
337
 
 
338
 
 
339
 
 
340
 
=== TEST 16: phase issue
341
 
--- config
342
 
    chunkin on;
343
 
    location /ar.do {
344
 
        deny all;
345
 
        echo_request_body;
346
 
    }
347
 
--- more_headers
348
 
Transfer-Encoding: chunked
349
 
--- request eval
350
 
"POST /ar.do
351
 
1\r
352
 
a\r
353
 
0\r
354
 
\r
355
 
"
356
 
--- response_body_like: 403 Forbidden
357
 
--- error_code: 403
358
 
 
359
 
 
360
 
 
361
 
=== TEST 17: contenth-length AND chunked
362
 
--- config
363
 
    chunkin on;
364
 
    location /aar.do {
365
 
        echo_request_body;
366
 
    }
367
 
--- more_headers
368
 
Transfer-Encoding: chunked
369
 
--- raw_request eval
370
 
"POST /aar.do HTTP/1.1\r
371
 
Host: data.test.com\r
372
 
Content-Type:application/octet-stream\r
373
 
transfer-encoding:chunked\r
374
 
User-Agent: SEC-SGHD840/1.0 NetFront/3.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 UNTRUSTED/1.0\r
375
 
Content-Length: 6263\r
376
 
Via: ZXWAP GateWay,ZTE Technologies\r
377
 
x-up-calling-line-id: 841223657459\r
378
 
Connection: close\r
379
 
\r
380
 
5\r
381
 
hello\r
382
 
0\r
383
 
\r
384
 
"
385
 
--- response_body: hello
386
 
--- timeout: 1
387
 
 
388
 
 
389
 
 
390
 
=== TEST 18: Content-length AND chunked
391
 
--- config
392
 
    chunkin on;
393
 
    location /aar.do {
394
 
        echo_request_body;
395
 
    }
396
 
--- raw_request eval
397
 
["POST /aar.do HTTP/1.1\r
398
 
Host: data.test.com\r
399
 
Content-Type:application/octet-stream\r
400
 
transfer-encoding:chunked\r
401
 
User-Agent: SEC-SGHD840/1.0 NetFront/3.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 UNTRUSTED/1.0\r
402
 
Content-Length: 6263\r
403
 
Via: ZXWAP GateWay,ZTE Technologies\r
404
 
x-up-calling-line-id: 841223657459\r
405
 
Connection: close\r
406
 
\r
407
 
5\r
408
 
", "hell","o\r
409
 
", "0\r
410
 
\r
411
 
"]
412
 
--- raw_request_middle_delay: 0.001
413
 
--- response_body: hello
414
 
--- timeout: 4
415
 
 
416
 
 
417
 
 
418
 
=== TEST 19: Content-length AND chunked (ready for the read_discard_request_body to work)
419
 
--- config
420
 
    chunkin on;
421
 
    location /aar.do {
422
 
        echo_request_body;
423
 
    }
424
 
--- raw_request eval
425
 
["POST /aar.do HTTP/1.1\r
426
 
Host: data.test.com\r
427
 
Content-Type:application/octet-stream\r
428
 
transfer-encoding:chunked\r
429
 
User-Agent: SEC-SGHD840/1.0 NetFront/3.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 UNTRUSTED/1.0\r
430
 
Content-Length: 6263\r
431
 
Via: ZXWAP GateWay,ZTE Technologies\r
432
 
x-up-calling-line-id: 841223657459\r
433
 
Connection: close\r
434
 
\r
435
 
5\r
436
 
", "hell","o\r
437
 
", "0\r
438
 
\r
439
 
"]
440
 
--- raw_request_middle_delay: 0
441
 
--- response_body: hello
442
 
--- timeout: 1
443
 
 
444
 
 
445
 
 
446
 
=== TEST 20: packets in a single buf
447
 
--- config
448
 
    chunkin on;
449
 
    location /aar.do {
450
 
        client_body_buffer_size 1m;
451
 
        echo_request_body;
452
 
    }
453
 
--- raw_request eval
454
 
["POST /aar.do HTTP/1.1\r
455
 
Content-Type: application/octet-stream\r
456
 
Connection: close\r
457
 
Host: data.test.com\r
458
 
Transfer-Encoding: chunked\r
459
 
User-Agent: SonyEricssonW395/R1BA010 Profile/MIDP-2.1 Configuration/CLDC-1.1 UNTRUSTED/1.0\r
460
 
\r
461
 
",
462
 
"535\r
463
 
".('a' x 1228),
464
 
('a' x 107), "\r
465
 
", "0\r
466
 
\r
467
 
"]
468
 
--- raw_request_middle_delay: 0.002
469
 
--- response_body: hello
470
 
--- timeout: 2
471
 
--- SKIP
472
 
 
473
 
 
474
 
 
475
 
=== TEST 21: packets in a single buf
476
 
--- config
477
 
    chunkin on;
478
 
    location /aar.do {
479
 
        client_body_buffer_size 1m;
480
 
        echo_request_body;
481
 
    }
482
 
--- raw_request eval
483
 
["POST /aar.do HTTP/1.1\r
484
 
Content-Type: application/octet-stream\r
485
 
Connection: close\r
486
 
Host: data.test.com\r
487
 
Transfer-Encoding: chunked\r
488
 
User-Agent: SonyEricssonW395/R1BA010 Profile/MIDP-2.1 Configuration/CLDC-1.1 UNTRUSTED/1.0\r
489
 
\r
490
 
",
491
 
"535\r
492
 
".('a' x 1228),
493
 
('a' x 105) . "\r
494
 
", "0\r
495
 
\r
496
 
"]
497
 
--- raw_request_middle_delay: 0.002
498
 
--- response_body eval
499
 
'a' x 0x535
500
 
--- timeout: 5
501
 
 
502
 
 
503
 
 
504
 
=== TEST 22: packets in a single buf
505
 
--- config
506
 
    chunkin on;
507
 
    location /aar.do {
508
 
        client_body_buffer_size 1m;
509
 
        echo_request_body;
510
 
    }
511
 
--- raw_request eval
512
 
["POST /aar.do HTTP/1.1\r
513
 
Content-Type: application/octet-stream\r
514
 
Connection: close\r
515
 
Host: data.test.com\r
516
 
Transfer-Encoding: chunked\r
517
 
User-Agent: SonyEricssonW395/R1BA010 Profile/MIDP-2.1 Configuration/CLDC-1.1 UNTRUSTED/1.0\r
518
 
\r
519
 
",
520
 
"7e0\r
521
 
".('a' x 2016)."\r",
522
 
"aaaa
523
 
", "0\r
524
 
\r
525
 
"]
526
 
--- raw_request_middle_delay: 0.002
527
 
--- response_body eval
528
 
'a' x 0x7e0
529
 
--- timeout: 2
530
 
--- SKIP
531
 
 
532
 
 
533
 
 
534
 
=== TEST 23: not exceeding max body limit (chunk spanning preread and rb->buf)
535
 
--- config
536
 
    chunkin on;
537
 
    location /main {
538
 
        client_body_buffer_size    10m;
539
 
        client_max_body_size       10m;
540
 
        chunkin_max_chunks_per_buf 2048;
541
 
 
542
 
        echo_read_request_body;
543
 
 
544
 
        echo_request_body;
545
 
        echo;
546
 
    }
547
 
--- more_headers
548
 
#Transfer-Encoding: chunked
549
 
--- request eval
550
 
"POST /main
551
 
".("a" x (1 * 1024 * 1024))
552
 
--- response_body eval
553
 
"a" x (1 * 1024 * 1024)
554
 
--- timeout: 60
555
 
--- SKIP
556
 
 
557
 
 
558
 
 
559
 
=== TEST 24: binary in data
560
 
--- config
561
 
    chunkin on;
562
 
    location /ar.do {
563
 
        echo $request_method;
564
 
        echo_request_body;
565
 
    }
566
 
--- more_headers
567
 
Transfer-Encoding: chunked
568
 
--- request eval
569
 
"DELETE /ar.do
570
 
5\r
571
 
hello\r
572
 
0\r
573
 
\r
574
 
"
575
 
--- response_body chop
576
 
DELETE
577
 
hello
578