comparison proxy_cookie.t @ 1585:bff287fbf347

Tests: added proxy_cookie_domain/path tests with "off" parameter.
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 23 Jul 2020 12:17:39 +0300
parents 882267679006
children
comparison
equal deleted inserted replaced
1584:b4014b3e8495 1585:bff287fbf347
49 49
50 proxy_cookie_path /path/ /new/; 50 proxy_cookie_path /path/ /new/;
51 proxy_cookie_path /$server_name/ /new/$server_name/; 51 proxy_cookie_path /$server_name/ /new/$server_name/;
52 proxy_cookie_path ~^/regex/(.+)$ /$1; 52 proxy_cookie_path ~^/regex/(.+)$ /$1;
53 proxy_cookie_path ~*^/caseless/(.+)$ /$1; 53 proxy_cookie_path ~*^/caseless/(.+)$ /$1;
54
55 location /off/ {
56 proxy_pass http://127.0.0.1:8081;
57
58 proxy_cookie_domain off;
59 proxy_cookie_path off;
60 }
54 } 61 }
55 } 62 }
56 63
57 server { 64 server {
58 listen 127.0.0.1:8081; 65 listen 127.0.0.1:8081;
71 } 78 }
72 } 79 }
73 80
74 EOF 81 EOF
75 82
76 $t->run()->plan(8); 83 $t->run()->plan(9);
77 84
78 ############################################################################### 85 ###############################################################################
79 86
80 my $port = port(8080); 87 my $port = port(8080);
81 88
98 'v=path=domain=; Path=/test.html', 'path caseless regex rewrite'); 105 'v=path=domain=; Path=/test.html', 'path caseless regex rewrite');
99 106
100 is(http_get_set_cookie('/?domain=www.example.org&path=/path/test.html'), 107 is(http_get_set_cookie('/?domain=www.example.org&path=/path/test.html'),
101 'v=path=domain=; Domain=example.com; Path=/new/test.html', 108 'v=path=domain=; Domain=example.com; Path=/new/test.html',
102 'domain and path rewrite'); 109 'domain and path rewrite');
110 is(http_get_set_cookie('/off/?domain=www.example.org&path=/path/test.html'),
111 'v=path=domain=; Domain=www.example.org; Path=/path/test.html',
112 'domain and path rewrite off');
103 113
104 ############################################################################### 114 ###############################################################################
105 115
106 sub http_get_set_cookie { 116 sub http_get_set_cookie {
107 my ($uri) = @_; 117 my ($uri) = @_;