Mercurial > hg > nginx-tests
annotate body_discard.t @ 1990:85d88cd5091c
Tests: SSI include stub tests.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 04 Jul 2024 17:42:55 +0300 |
parents | fe6f22da53ec |
children |
rev | line source |
---|---|
1961
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
1 #!/usr/bin/perl |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
2 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
3 # (C) Maxim Dounin |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
4 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
5 # Tests for discarding request body. |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
6 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
7 ############################################################################### |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
8 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
9 use warnings; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
10 use strict; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
11 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
12 use Test::More; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
13 use Socket qw/ CRLF /; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
14 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
15 BEGIN { use FindBin; chdir($FindBin::Bin); } |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
16 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
17 use lib 'lib'; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
18 use Test::Nginx; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
19 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
20 ############################################################################### |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
21 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
22 select STDERR; $| = 1; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
23 select STDOUT; $| = 1; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
24 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
25 my $t = Test::Nginx->new() |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
26 ->has(qw/http proxy rewrite addition memcached/); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
27 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
28 plan(skip_all => 'not yet') unless $t->has_version('1.27.0'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
29 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
30 $t->plan(33)->write_file_expand('nginx.conf', <<'EOF'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
31 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
32 %%TEST_GLOBALS%% |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
33 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
34 daemon off; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
35 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
36 events { |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
37 } |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
38 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
39 http { |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
40 %%TEST_GLOBALS_HTTP%% |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
41 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
42 server { |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
43 listen 127.0.0.1:8080; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
44 server_name localhost; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
45 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
46 lingering_timeout 1s; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
47 add_header X-Body body:$content_length:$request_body:; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
48 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
49 client_max_body_size 1k; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
50 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
51 error_page 400 /proxy/error400; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
52 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
53 location / { |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
54 error_page 413 /error413; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
55 proxy_pass http://127.0.0.1:8082; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
56 } |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
57 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
58 location /error413 { |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
59 return 200 "custom error 413"; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
60 } |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
61 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
62 location /add { |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
63 return 200 "main response"; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
64 add_before_body /add/before; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
65 addition_types *; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
66 client_max_body_size 1m; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
67 } |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
68 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
69 location /add/before { |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
70 proxy_pass http://127.0.0.1:8081; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
71 } |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
72 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
73 location /memcached { |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
74 client_max_body_size 1m; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
75 error_page 502 /memcached/error502; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
76 memcached_pass 127.0.0.1:8083; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
77 set $memcached_key $request_uri; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
78 } |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
79 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
80 location /memcached/error502 { |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
81 proxy_pass http://127.0.0.1:8081; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
82 } |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
83 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
84 location /proxy { |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
85 client_max_body_size 1; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
86 error_page 413 /proxy/error413; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
87 error_page 400 /proxy/error400; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
88 error_page 502 /proxy/error502; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
89 proxy_pass http://127.0.0.1:8083; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
90 } |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
91 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
92 location /proxy/error413 { |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
93 proxy_pass http://127.0.0.1:8081; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
94 } |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
95 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
96 location /proxy/error400 { |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
97 proxy_pass http://127.0.0.1:8081; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
98 } |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
99 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
100 location /proxy/error502 { |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
101 proxy_pass http://127.0.0.1:8081; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
102 } |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
103 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
104 location /unbuf { |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
105 client_max_body_size 1m; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
106 error_page 502 /unbuf/error502; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
107 proxy_pass http://127.0.0.1:8083; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
108 proxy_request_buffering off; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
109 proxy_http_version 1.1; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
110 } |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
111 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
112 location /unbuf/error502 { |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
113 client_max_body_size 1m; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
114 proxy_pass http://127.0.0.1:8081; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
115 } |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
116 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
117 location /length { |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
118 client_max_body_size 1; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
119 error_page 413 /length/error413; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
120 error_page 502 /length/error502; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
121 proxy_pass http://127.0.0.1:8083; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
122 } |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
123 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
124 location /length/error413 { |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
125 return 200 "frontend body:$content_length:$request_body:"; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
126 } |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
127 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
128 location /length/error502 { |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
129 return 200 "frontend body:$content_length:$request_body:"; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
130 } |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
131 } |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
132 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
133 server { |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
134 listen 127.0.0.1:8081; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
135 server_name localhost; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
136 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
137 location / { |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
138 proxy_pass http://127.0.0.1:8082; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
139 proxy_set_header X-Body body:$content_length:$request_body:; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
140 } |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
141 } |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
142 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
143 server { |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
144 listen 127.0.0.1:8082; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
145 server_name localhost; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
146 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
147 return 200 "backend $http_x_body"; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
148 } |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
149 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
150 server { |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
151 listen 127.0.0.1:8083; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
152 server_name localhost; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
153 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
154 return 444; |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
155 } |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
156 } |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
157 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
158 EOF |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
159 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
160 $t->run(); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
161 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
162 ############################################################################### |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
163 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
164 # error_page 413 should work without redefining client_max_body_size |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
165 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
166 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
167 'POST / HTTP/1.0' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
168 'Content-Length: 10000' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
169 '0123456789' |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
170 ), qr/ 413 .*custom error 413/s, 'custom error 413'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
171 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
172 # subrequest after discarding body |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
173 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
174 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
175 'GET /add HTTP/1.0' . CRLF . CRLF |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
176 ), qr/backend body:::.*main response/s, 'add'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
177 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
178 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
179 'POST /add HTTP/1.0' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
180 'Content-Length: 10' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
181 '0123456789' |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
182 ), qr/backend body:::.*main response/s, 'add small'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
183 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
184 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
185 'POST /add HTTP/1.0' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
186 'Content-Length: 10000' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
187 '0123456789' |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
188 ), qr/backend body:::.*main response/s, 'add long'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
189 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
190 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
191 'POST /add HTTP/1.1' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
192 'Host: localhost' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
193 'Connection: close' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
194 'Transfer-Encoding: chunked' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
195 'a' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
196 '0123456789' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
197 '0' . CRLF . CRLF |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
198 ), qr/backend body:::.*main response/s, 'add chunked'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
199 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
200 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
201 'POST /add HTTP/1.1' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
202 'Host: localhost' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
203 'Connection: close' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
204 'Transfer-Encoding: chunked' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
205 '1' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
206 'X' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
207 '9' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
208 '123456789' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
209 '0' . CRLF . CRLF |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
210 ), qr/backend body:::.*main response/s, 'add chunked multi'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
211 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
212 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
213 'POST /add HTTP/1.1' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
214 'Host: localhost' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
215 'Connection: close' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
216 'Transfer-Encoding: chunked' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
217 'ffff' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
218 '0123456789' |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
219 ), qr/backend body:::.*main response/s, 'add chunked long'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
220 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
221 # error_page 502 with proxy_pass after discarding body |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
222 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
223 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
224 'GET /memcached HTTP/1.0' . CRLF . CRLF |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
225 ), qr/ 502 .*backend body:::/s, 'memcached'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
226 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
227 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
228 'GET /memcached HTTP/1.0' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
229 'Content-Length: 10' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
230 '0123456789' |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
231 ), qr/ 502 .*backend body:::/s, 'memcached small'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
232 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
233 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
234 'GET /memcached HTTP/1.0' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
235 'Content-Length: 10000' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
236 '0123456789' |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
237 ), qr/ 502 .*backend body:::/s, 'memcached long'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
238 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
239 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
240 'GET /memcached HTTP/1.1' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
241 'Host: localhost' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
242 'Connection: close' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
243 'Transfer-Encoding: chunked' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
244 'a' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
245 '0123456789' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
246 '0' . CRLF . CRLF |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
247 ), qr/ 502 .*backend body:::/s, 'memcached chunked'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
248 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
249 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
250 'GET /memcached HTTP/1.1' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
251 'Host: localhost' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
252 'Connection: close' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
253 'Transfer-Encoding: chunked' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
254 '1' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
255 'X' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
256 '9' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
257 '123456789' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
258 '0' . CRLF . CRLF |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
259 ), qr/ 502 .*backend body:::/s, 'memcached chunked multi'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
260 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
261 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
262 'GET /memcached HTTP/1.1' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
263 'Host: localhost' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
264 'Connection: close' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
265 'Transfer-Encoding: chunked' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
266 'ffff' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
267 '0123456789' |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
268 ), qr/ 502 .*backend body:::/s, 'memcached chunked long'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
269 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
270 # error_page 413 with proxy_pass |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
271 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
272 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
273 'GET /proxy HTTP/1.0' . CRLF . CRLF |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
274 ), qr/ 502 .*backend body:::/s, 'proxy'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
275 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
276 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
277 'POST /proxy HTTP/1.0' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
278 'Content-Length: 10' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
279 '0123456789' |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
280 ), qr/ 413 .*backend body:::/s, 'proxy small'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
281 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
282 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
283 'POST /proxy HTTP/1.0' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
284 'Content-Length: 10000' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
285 '0123456789' |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
286 ), qr/ 413 .*backend body:::/s, 'proxy long'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
287 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
288 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
289 'POST /proxy HTTP/1.1' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
290 'Host: localhost' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
291 'Connection: close' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
292 'Transfer-Encoding: chunked' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
293 'a' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
294 '0123456789' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
295 '0' . CRLF . CRLF |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
296 ), qr/ 413 .*backend body:::/s, 'proxy chunked'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
297 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
298 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
299 'POST /proxy HTTP/1.1' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
300 'Host: localhost' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
301 'Connection: close' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
302 'Transfer-Encoding: chunked' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
303 '1' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
304 'X' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
305 '9' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
306 '123456789' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
307 '0' . CRLF . CRLF |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
308 ), qr/ 413 .*backend body:::/s, 'proxy chunked multi'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
309 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
310 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
311 'POST /proxy HTTP/1.1' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
312 'Host: localhost' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
313 'Connection: close' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
314 'Transfer-Encoding: chunked' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
315 'ffff' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
316 '0123456789' |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
317 ), qr/ 413 .*backend body:::/s, 'proxy chunked long'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
318 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
319 # error_page 400 with proxy_pass |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
320 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
321 # note that "chunked and length" test triggers 400 during parsing |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
322 # request headers, and therefore needs error_page at server level |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
323 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
324 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
325 'POST /proxy HTTP/1.1' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
326 'Host: localhost' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
327 'Connection: close' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
328 'Transfer-Encoding: chunked' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
329 '1' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
330 'X' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
331 'X' . CRLF |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
332 ), qr/ 400 .*backend body:::/s, 'proxy chunked bad'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
333 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
334 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
335 'POST /proxy HTTP/1.1' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
336 'Host: localhost' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
337 'Connection: close' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
338 'Content-Length: 10' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
339 'Transfer-Encoding: chunked' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
340 '0' . CRLF . CRLF |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
341 ), qr/ 400 .*backend body:::/s, 'proxy chunked and length'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
342 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
343 # error_page 502 after proxy with request buffering disabled |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
344 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
345 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
346 'GET /unbuf HTTP/1.0' . CRLF . CRLF |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
347 ), qr/ 502 .*backend body:::/s, 'unbuf proxy'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
348 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
349 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
350 'POST /unbuf HTTP/1.0' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
351 'Content-Length: 10' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
352 '0', |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
353 sleep => 0.1, |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
354 body => |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
355 '123456789' |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
356 ), qr/ 502 .*backend body:::/s, 'unbuf proxy small'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
357 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
358 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
359 'POST /unbuf HTTP/1.0' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
360 'Content-Length: 10000' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
361 '0123456789' |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
362 ), qr/ 502 .*backend body:::/s, 'unbuf proxy long'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
363 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
364 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
365 'POST /unbuf HTTP/1.1' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
366 'Host: localhost' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
367 'Connection: close' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
368 'Transfer-Encoding: chunked' . CRLF . CRLF, |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
369 sleep => 0.1, |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
370 body => |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
371 'a' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
372 '0123456789' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
373 '0' . CRLF . CRLF |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
374 ), qr/ 502 .*backend body:::/s, 'unbuf proxy chunked'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
375 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
376 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
377 'POST /unbuf HTTP/1.1' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
378 'Host: localhost' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
379 'Connection: close' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
380 'Transfer-Encoding: chunked' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
381 '1' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
382 'X' . CRLF, |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
383 sleep => 0.1, |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
384 body => |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
385 '9' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
386 '123456789' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
387 '0' . CRLF . CRLF |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
388 ), qr/ 502 .*backend body:::/s, 'unbuf proxy chunked multi'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
389 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
390 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
391 'POST /unbuf HTTP/1.1' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
392 'Host: localhost' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
393 'Connection: close' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
394 'Transfer-Encoding: chunked' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
395 'ffff' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
396 '0123456789' |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
397 ), qr/ 502 .*backend body:::/s, 'unbuf proxy chunked long'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
398 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
399 # error_page 413 and $content_length |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
400 # (used in fastcgi_pass, grpc_pass, uwsgi_pass) |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
401 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
402 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
403 'GET /length HTTP/1.0' . CRLF . CRLF |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
404 ), qr/ 502 .*frontend body:::/s, '$content_length'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
405 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
406 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
407 'POST /length HTTP/1.0' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
408 'Content-Length: 10' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
409 '0123456789' |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
410 ), qr/ 413 .*frontend body:::/s, '$content_length small'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
411 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
412 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
413 'POST /length HTTP/1.0' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
414 'Content-Length: 10000' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
415 '0123456789' |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
416 ), qr/ 413 .*frontend body:::/s, '$content_length long'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
417 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
418 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
419 'POST /length HTTP/1.1' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
420 'Host: localhost' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
421 'Connection: close' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
422 'Transfer-Encoding: chunked' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
423 'a' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
424 '0123456789' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
425 '0' . CRLF . CRLF |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
426 ), qr/ 413 .*frontend body:::/s, '$content_length chunked'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
427 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
428 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
429 'POST /length HTTP/1.1' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
430 'Host: localhost' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
431 'Connection: close' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
432 'Transfer-Encoding: chunked' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
433 '1' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
434 'X' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
435 '9' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
436 '123456789' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
437 '0' . CRLF . CRLF |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
438 ), qr/ 413 .*frontend body:::/s, '$content_length chunked multi'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
439 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
440 like(http( |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
441 'POST /length HTTP/1.1' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
442 'Host: localhost' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
443 'Connection: close' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
444 'Transfer-Encoding: chunked' . CRLF . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
445 'ffff' . CRLF . |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
446 '0123456789' |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
447 ), qr/ 413 .*frontend body:::/s, '$content_length chunked long'); |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
448 |
fe6f22da53ec
Tests: tests for usage of discarded body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
449 ############################################################################### |