Mercurial > hg > nginx-tests
annotate not_modified_proxy.t @ 1990:85d88cd5091c
Tests: SSI include stub tests.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 04 Jul 2024 17:42:55 +0300 |
parents | 196d33c2bb45 |
children |
rev | line source |
---|---|
418
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
1 #!/usr/bin/perl |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
2 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
3 # (C) Maxim Dounin |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
4 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
5 # Tests for not modified filter module and it's interaction with proxy. |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
6 # |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
7 # Notably, requests which are proxied should be skipped (that is, if |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
8 # a backend returned 200, we should pass 200 to a client without any |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
9 # attempts to handle conditional headers in the request), but responses |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
10 # from cache should be handled. |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
11 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
12 ############################################################################### |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
13 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
14 use warnings; |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
15 use strict; |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
16 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
17 use Test::More; |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
18 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
19 BEGIN { use FindBin; chdir($FindBin::Bin); } |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
20 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
21 use lib 'lib'; |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
22 use Test::Nginx; |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
23 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
24 ############################################################################### |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
25 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
26 select STDERR; $| = 1; |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
27 select STDOUT; $| = 1; |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
28 |
1020
196d33c2bb45
Tests: removed TODO and try_run() checks for legacy versions.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
974
diff
changeset
|
29 my $t = Test::Nginx->new()->has(qw/http proxy cache/)->plan(12); |
674
2d10f958741d
Tests: adjusted todo_alerts() in not_modified_proxy.t.
Sergey Kandaurov <pluknet@nginx.com>
parents:
638
diff
changeset
|
30 |
2d10f958741d
Tests: adjusted todo_alerts() in not_modified_proxy.t.
Sergey Kandaurov <pluknet@nginx.com>
parents:
638
diff
changeset
|
31 $t->write_file_expand('nginx.conf', <<'EOF'); |
418
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
32 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
33 %%TEST_GLOBALS%% |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
34 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
35 daemon off; |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
36 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
37 events { |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
38 } |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
39 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
40 http { |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
41 %%TEST_GLOBALS_HTTP%% |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
42 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
43 proxy_cache_path %%TESTDIR%%/cache keys_zone=one:1m; |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
44 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
45 proxy_set_header If-Modified-Since ""; |
638
f758c780c508
Tests: If-Unmodified-Since for not modified filter with proxy.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
46 proxy_set_header If-Unmodified-Since ""; |
418
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
47 proxy_set_header If-None-Match ""; |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
48 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
49 server { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
50 listen 127.0.0.1:8080; |
418
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
51 server_name localhost; |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
52 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
53 location / { |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
54 } |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
55 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
56 location /etag { |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
57 add_header Last-Modified ""; |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
58 } |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
59 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
60 location /proxy/ { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
61 proxy_pass http://127.0.0.1:8080/; |
418
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
62 } |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
63 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
64 location /cache/ { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
65 proxy_pass http://127.0.0.1:8080/; |
418
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
66 proxy_cache one; |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
67 proxy_cache_valid 200 1y; |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
68 } |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
69 } |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
70 } |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
71 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
72 EOF |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
73 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
74 $t->write_file('t', ''); |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
75 $t->write_file('etag', ''); |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
76 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
77 $t->run(); |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
78 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
79 ############################################################################### |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
80 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
81 my ($t1, $lm, $etag); |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
82 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
83 $t1 = http_get('/cache/t'); |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
84 $t1 =~ /Last-Modified: (.*)/; $lm = $1; |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
85 $t1 =~ /ETag: (.*)/; $etag = $1; |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
86 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
87 like(http_get_ims('/t', $lm), qr/ 304 /, 'if-modified-since'); |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
88 like(http_get_ims('/proxy/t', $lm), qr/ 200 /, 'ims proxy ignored'); |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
89 like(http_get_ims('/cache/t', $lm), qr/ 304 /, 'ims from cache'); |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
90 |
638
f758c780c508
Tests: If-Unmodified-Since for not modified filter with proxy.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
91 $t1 = 'Fri, 05 Jul 1985 14:30:52 GMT'; |
f758c780c508
Tests: If-Unmodified-Since for not modified filter with proxy.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
92 |
f758c780c508
Tests: If-Unmodified-Since for not modified filter with proxy.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
93 like(http_get_iums('/t', $t1), qr/ 412 /, 'if-unmodified-since'); |
f758c780c508
Tests: If-Unmodified-Since for not modified filter with proxy.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
94 like(http_get_iums('/proxy/t', $t1), qr/ 200 /, 'iums proxy ignored'); |
f758c780c508
Tests: If-Unmodified-Since for not modified filter with proxy.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
95 like(http_get_iums('/cache/t', $t1), qr/ 412 /, 'iums from cache'); |
f758c780c508
Tests: If-Unmodified-Since for not modified filter with proxy.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
96 |
418
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
97 like(http_get_inm('/t', $etag), qr/ 304 /, 'if-none-match'); |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
98 like(http_get_inm('/proxy/t', $etag), qr/ 200 /, 'inm proxy ignored'); |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
99 like(http_get_inm('/cache/t', $etag), qr/ 304 /, 'inm from cache'); |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
100 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
101 # backend response with ETag only, no Last-Modified |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
102 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
103 $t1 = http_get('/cache/etag'); |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
104 $t1 =~ /ETag: (.*)/; $etag = $1; |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
105 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
106 like(http_get_inm('/etag', $etag), qr/ 304 /, 'if-none-match etag only'); |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
107 like(http_get_inm('/proxy/etag', $etag), qr/ 200 /, 'inm etag proxy ignored'); |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
108 like(http_get_inm('/cache/etag', $etag), qr/ 304 /, 'inm etag from cache'); |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
109 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
110 ############################################################################### |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
111 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
112 sub http_get_ims { |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
113 my ($url, $ims) = @_; |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
114 return http(<<EOF); |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
115 GET $url HTTP/1.0 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
116 Host: localhost |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
117 If-Modified-Since: $ims |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
118 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
119 EOF |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
120 } |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
121 |
638
f758c780c508
Tests: If-Unmodified-Since for not modified filter with proxy.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
122 sub http_get_iums { |
f758c780c508
Tests: If-Unmodified-Since for not modified filter with proxy.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
123 my ($url, $ims) = @_; |
f758c780c508
Tests: If-Unmodified-Since for not modified filter with proxy.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
124 return http(<<EOF); |
f758c780c508
Tests: If-Unmodified-Since for not modified filter with proxy.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
125 GET $url HTTP/1.0 |
f758c780c508
Tests: If-Unmodified-Since for not modified filter with proxy.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
126 Host: localhost |
f758c780c508
Tests: If-Unmodified-Since for not modified filter with proxy.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
127 If-Unmodified-Since: $ims |
f758c780c508
Tests: If-Unmodified-Since for not modified filter with proxy.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
128 |
f758c780c508
Tests: If-Unmodified-Since for not modified filter with proxy.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
129 EOF |
f758c780c508
Tests: If-Unmodified-Since for not modified filter with proxy.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
130 } |
f758c780c508
Tests: If-Unmodified-Since for not modified filter with proxy.
Sergey Kandaurov <pluknet@nginx.com>
parents:
574
diff
changeset
|
131 |
418
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
132 sub http_get_inm { |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
133 my ($url, $inm) = @_; |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
134 return http(<<EOF); |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
135 GET $url HTTP/1.0 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
136 Host: localhost |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
137 If-None-Match: $inm |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
138 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
139 EOF |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
140 } |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
141 |
861e6cad6299
Tests: tests for not modified filter with proxy.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
142 ############################################################################### |