Mercurial > hg > nginx-tests
annotate proxy_non_idempotent.t @ 1990:85d88cd5091c
Tests: SSI include stub tests.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 04 Jul 2024 17:42:55 +0300 |
parents | 97c8280de681 |
children |
rev | line source |
---|---|
887
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
1 #!/usr/bin/perl |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
2 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
3 # (C) Maxim Dounin |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
4 # (C) Nginx, Inc. |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
5 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
6 # Tests for proxy_next_upstream non_idempotent. |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
7 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
8 ############################################################################### |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
9 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
10 use warnings; |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
11 use strict; |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
12 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
13 use Test::More; |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
14 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
15 BEGIN { use FindBin; chdir($FindBin::Bin); } |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
16 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
17 use lib 'lib'; |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
18 use Test::Nginx; |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
19 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
20 ############################################################################### |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
21 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
22 select STDERR; $| = 1; |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
23 select STDOUT; $| = 1; |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
24 |
1020
196d33c2bb45
Tests: removed TODO and try_run() checks for legacy versions.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
974
diff
changeset
|
25 my $t = Test::Nginx->new()->has(qw/http proxy rewrite upstream_keepalive/) |
1316
d51cc2526066
Tests: added ngx_http_upstream_test_next() cases.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
26 ->plan(8); |
887
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
27 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
28 $t->write_file_expand('nginx.conf', <<'EOF'); |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
29 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
30 %%TEST_GLOBALS%% |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
31 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
32 daemon off; |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
33 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
34 events { |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
35 } |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
36 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
37 http { |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
38 %%TEST_GLOBALS_HTTP%% |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
39 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
40 upstream u { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
41 server 127.0.0.1:8081 max_fails=0; |
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
42 server 127.0.0.1:8081 max_fails=0; |
887
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
43 } |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
44 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
45 upstream uk { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
46 server 127.0.0.1:8081 max_fails=0; |
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
47 server 127.0.0.1:8081 max_fails=0; |
887
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
48 keepalive 10; |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
49 } |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
50 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
51 server { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
52 listen 127.0.0.1:8080; |
887
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
53 server_name localhost; |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
54 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
55 add_header X-IP $upstream_addr always; |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
56 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
57 location / { |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
58 proxy_pass http://u; |
1316
d51cc2526066
Tests: added ngx_http_upstream_test_next() cases.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
59 proxy_next_upstream error timeout http_404; |
887
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
60 } |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
61 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
62 location /non { |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
63 proxy_pass http://u; |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
64 proxy_next_upstream error timeout non_idempotent; |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
65 } |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
66 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
67 location /keepalive { |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
68 proxy_pass http://uk; |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
69 proxy_next_upstream error timeout; |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
70 proxy_http_version 1.1; |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
71 proxy_set_header Connection ""; |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
72 } |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
73 } |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
74 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
75 server { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
76 listen 127.0.0.1:8081; |
887
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
77 server_name localhost; |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
78 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
79 location / { |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
80 return 444; |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
81 } |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
82 |
1316
d51cc2526066
Tests: added ngx_http_upstream_test_next() cases.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
83 location /404 { |
d51cc2526066
Tests: added ngx_http_upstream_test_next() cases.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
84 return 404 SEE-THIS; |
d51cc2526066
Tests: added ngx_http_upstream_test_next() cases.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
85 } |
d51cc2526066
Tests: added ngx_http_upstream_test_next() cases.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
86 |
887
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
87 location /keepalive/establish { |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
88 return 204; |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
89 } |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
90 } |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
91 } |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
92 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
93 EOF |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
94 |
1020
196d33c2bb45
Tests: removed TODO and try_run() checks for legacy versions.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
974
diff
changeset
|
95 $t->run(); |
887
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
96 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
97 ############################################################################### |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
98 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
99 # non-idempotent requests should not be retried by default |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
100 # if a request has been sent to a backend |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
101 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
102 like(http_get('/'), qr/X-IP: (\S+), \1\x0d?$/m, 'get'); |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
103 like(http_post('/'), qr/X-IP: (\S+)\x0d?$/m, 'post'); |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
104 |
1316
d51cc2526066
Tests: added ngx_http_upstream_test_next() cases.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
105 # non-idempotent requests should not be retried by default, |
d51cc2526066
Tests: added ngx_http_upstream_test_next() cases.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
106 # in particular, not emit builtin error page due to next upstream |
d51cc2526066
Tests: added ngx_http_upstream_test_next() cases.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
107 |
d51cc2526066
Tests: added ngx_http_upstream_test_next() cases.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
108 like(http_get('/404'), qr/X-IP: (\S+), \1.*SEE-THIS/s, 'get 404'); |
d51cc2526066
Tests: added ngx_http_upstream_test_next() cases.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
109 like(http_post('/404'), qr/X-IP: (\S++)(?! ).*SEE-THIS/s, 'post 404'); |
d51cc2526066
Tests: added ngx_http_upstream_test_next() cases.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1020
diff
changeset
|
110 |
887
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
111 # with "proxy_next_upstream non_idempotent" there is no |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
112 # difference between idempotent and non-idempotent requests, |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
113 # non-idempotent requests are retried as usual |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
114 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
115 like(http_get('/non'), qr/X-IP: (\S+), \1\x0d?$/m, 'get non_idempotent'); |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
116 like(http_post('/non'), qr/X-IP: (\S+), \1\x0d?$/m, 'post non_idempotent'); |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
117 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
118 # cached connections follow the same rules |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
119 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
120 like(http_get('/keepalive/establish'), qr/204 No Content/m, 'keepalive'); |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
121 like(http_post('/keepalive/drop'), qr/X-IP: (\S+)\x0d?$/m, 'keepalive post'); |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
122 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
123 ############################################################################### |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
124 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
125 sub http_post { |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
126 my ($uri, %extra) = @_; |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
127 my $cl = $extra{cl} || 0; |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
128 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
129 http(<<"EOF"); |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
130 POST $uri HTTP/1.0 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
131 Content-Length: $cl |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
132 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
133 EOF |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
134 } |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
135 |
5debefd670bc
Tests: proxy_next_upstream non_idempotent tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
136 ############################################################################### |