Mercurial > hg > nginx-tests
comparison proxy_request_buffering_chunked.t @ 545:dbf8fb0f3d30
Tests: fixed unbuffered request body tests.
In particular, made sure that the whole request body is read on backend.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Wed, 08 Apr 2015 20:16:40 +0300 |
parents | e7e3ced702f5 |
children | 907e89fba9c3 |
comparison
equal
deleted
inserted
replaced
544:e82bbe71f50c | 545:dbf8fb0f3d30 |
---|---|
79 server { | 79 server { |
80 listen 127.0.0.1:8081; | 80 listen 127.0.0.1:8081; |
81 server_name localhost; | 81 server_name localhost; |
82 | 82 |
83 location / { | 83 location / { |
84 return 204; | 84 proxy_pass http://127.0.0.1:8080/discard; |
85 } | 85 } |
86 location /404 { } | 86 location /404 { } |
87 } | 87 } |
88 } | 88 } |
89 | 89 |
191 my $last = pop; | 191 my $last = pop; |
192 return http( join '', (map { | 192 return http( join '', (map { |
193 my $body = $_; | 193 my $body = $_; |
194 "GET $uri HTTP/1.1" . CRLF | 194 "GET $uri HTTP/1.1" . CRLF |
195 . "Host: localhost" . CRLF | 195 . "Host: localhost" . CRLF |
196 . "Content-Length: " . (length $body) . CRLF . CRLF | 196 . "Transfer-Encoding: chunked" . CRLF . CRLF |
197 . $body | 197 . sprintf("%x", length $body) . CRLF |
198 . $body . CRLF | |
199 . "0" . CRLF . CRLF | |
198 } @_), | 200 } @_), |
199 "GET $uri HTTP/1.1" . CRLF | 201 "GET $uri HTTP/1.1" . CRLF |
200 . "Host: localhost" . CRLF | 202 . "Host: localhost" . CRLF |
201 . "Connection: close" . CRLF | 203 . "Connection: close" . CRLF |
202 . "Content-Length: " . (length $last) . CRLF . CRLF | 204 . "Transfer-Encoding: chunked" . CRLF . CRLF |
203 . $last | 205 . sprintf("%x", length $last) . CRLF |
206 . $last . CRLF | |
207 . "0" . CRLF . CRLF | |
204 ); | 208 ); |
205 } | 209 } |
206 | 210 |
207 sub get_body { | 211 sub get_body { |
208 my ($url, $port, $body, %extra) = @_; | 212 my ($url, $port, $body, %extra) = @_; |