comparison http_uri.t @ 1714:e4e711d07e6c

Tests: added URI tests with forbidden control characters.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 29 Jun 2021 11:58:21 +0300
parents 9fac05e479fa
children 2a0a6035a1af
comparison
equal deleted inserted replaced
1713:77a9e393ed46 1714:e4e711d07e6c
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/)->plan(17) 25 my $t = Test::Nginx->new()->has(qw/http rewrite/)->plan(19)
26 ->write_file_expand('nginx.conf', <<'EOF')->run(); 26 ->write_file_expand('nginx.conf', <<'EOF')->run();
27 27
28 %%TEST_GLOBALS%% 28 %%TEST_GLOBALS%%
29 29
30 daemon off; 30 daemon off;
81 81
82 like(http_get('/ /'), qr/400 Bad/, 'space'); 82 like(http_get('/ /'), qr/400 Bad/, 'space');
83 83
84 } 84 }
85 85
86 TODO: {
87 local $TODO = 'not yet' unless $t->has_version('1.21.1');
88
89 like(http_get("/\x02"), qr/400 Bad/, 'control');
90
91 }
92
93 like(http_get('/%02'), qr!x /\x02 x!, 'control escaped');
94
86 ############################################################################### 95 ###############################################################################