Mercurial > hg > nginx-tests
comparison range_charset.t @ 491:d5bf5942a8b2
Tests: disambiguated parsing of the status code.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Fri, 07 Nov 2014 13:05:07 +0300 |
parents | 847ea345becb |
children | 2cd00179f4b2 |
comparison
equal
deleted
inserted
replaced
490:65d2d372ee31 | 491:d5bf5942a8b2 |
---|---|
82 # range request on proxied response with charset attribute in content-type | 82 # range request on proxied response with charset attribute in content-type |
83 # NB: to get partial content, requests need to be served from cache | 83 # NB: to get partial content, requests need to be served from cache |
84 | 84 |
85 http_get('/t1.html'); | 85 http_get('/t1.html'); |
86 $t1 = http_get_range('/t1.html', 'Range: bytes=0-9, 10-19'); | 86 $t1 = http_get_range('/t1.html', 'Range: bytes=0-9, 10-19'); |
87 like($t1, qr/206/, 'charset - 206 partial reply'); | 87 like($t1, qr/ 206 /, 'charset - 206 partial reply'); |
88 like($t1, qr/Content-Type: multipart\/byteranges; boundary=\w+\x0d\x0a/, | 88 like($t1, qr/Content-Type: multipart\/byteranges; boundary=\w+\x0d\x0a/, |
89 'charset - content type'); | 89 'charset - content type'); |
90 like($t1, qr/Content-Type: text\/html; charset=B(?!; charset)/, | 90 like($t1, qr/Content-Type: text\/html; charset=B(?!; charset)/, |
91 'charset - charset attribute'); | 91 'charset - charset attribute'); |
92 like($t1, qr/X000XXXXXX/m, 'charset - content 0-9'); | 92 like($t1, qr/X000XXXXXX/m, 'charset - content 0-9'); |
93 like($t1, qr/X001XXXXXX\x0d?$/m, 'charset - content 10-19'); | 93 like($t1, qr/X001XXXXXX\x0d?$/m, 'charset - content 10-19'); |
94 | 94 |
95 http_get('/t2.html'); | 95 http_get('/t2.html'); |
96 $t1 = http_get_range('/t2.html', 'Range: bytes=0-9, 10-19'); | 96 $t1 = http_get_range('/t2.html', 'Range: bytes=0-9, 10-19'); |
97 like($t1, qr/206/, 'x-accel-charset - 206 partial reply'); | 97 like($t1, qr/ 206 /, 'x-accel-charset - 206 partial reply'); |
98 like($t1, qr/Content-Type: multipart\/byteranges; boundary=\w+\x0d\x0a/, | 98 like($t1, qr/Content-Type: multipart\/byteranges; boundary=\w+\x0d\x0a/, |
99 'x-accel-charset - content type'); | 99 'x-accel-charset - content type'); |
100 like($t1, qr/Content-Type: text\/html; charset=A(?!; charset)/, | 100 like($t1, qr/Content-Type: text\/html; charset=A(?!; charset)/, |
101 'x-accel-charset - charset attribute'); | 101 'x-accel-charset - charset attribute'); |
102 like($t1, qr/Y000YYYYYY/m, 'x-accel-charset - content 0-9'); | 102 like($t1, qr/Y000YYYYYY/m, 'x-accel-charset - content 0-9'); |