comparison http_variables.t @ 441:cd61bacbbfe0

Tests: ensure that $uri is reset on URI parsing errors.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 22 Jul 2014 13:34:50 +0400
parents 5ed8ef14f79c
children 183f21bbe3d6
comparison
equal deleted inserted replaced
440:13ffba66f4e3 441:cd61bacbbfe0
20 ############################################################################### 20 ###############################################################################
21 21
22 select STDERR; $| = 1; 22 select STDERR; $| = 1;
23 select STDOUT; $| = 1; 23 select STDOUT; $| = 1;
24 24
25 my $t = Test::Nginx->new()->has(qw/http rewrite proxy/)->plan(3); 25 my $t = Test::Nginx->new()->has(qw/http rewrite proxy/)->plan(4);
26 26
27 $t->write_file_expand('nginx.conf', <<'EOF'); 27 $t->write_file_expand('nginx.conf', <<'EOF');
28 28
29 %%TEST_GLOBALS%% 29 %%TEST_GLOBALS%%
30 30
67 $t->run(); 67 $t->run();
68 68
69 ############################################################################### 69 ###############################################################################
70 70
71 http_get('/'); 71 http_get('/');
72 http_get('/../bad_uri');
72 http_get('/redefine'); 73 http_get('/redefine');
73 74
74 $t->stop(); 75 $t->stop();
75 76
76 my $log; 77 my $log;
81 local $/; 82 local $/;
82 $log = <LOG>; 83 $log = <LOG>;
83 close LOG; 84 close LOG;
84 } 85 }
85 86
87 TODO: {
88 local $TODO = 'not yet' unless $t->has_version('1.7.4');
89
90 like($log, qr!^: -$!m, 'no uri');
91
92 }
93
86 like($log, qr!^/: -$!m, 'no header'); 94 like($log, qr!^/: -$!m, 'no header');
87 like($log, qr!^/set: max-age=3600[,;] private[,;] must-revalidate$!m, 95 like($log, qr!^/set: max-age=3600[,;] private[,;] must-revalidate$!m,
88 'multi headers'); 96 'multi headers');
89 97
90 like($log, qr!^/redefine: no-cache$!m, 'ignoring headers with (hash == 0)'); 98 like($log, qr!^/redefine: no-cache$!m, 'ignoring headers with (hash == 0)');