File: query-string-with-semicolon.t

package info (click to toggle)
libmojolicious-plugin-cgi-perl 0.36-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 208 kB
  • ctags: 17
  • sloc: perl: 300; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 608 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use t::Helper;

my $this_will_mess_up;

use Mojolicious::Lite;

plugin CGI => {support_semicolon_in_query_string => 1};

app->hook(
  before_dispatch => sub {
    my $c = shift;
    $this_will_mess_up = $c->req->url->query->param('a');
  }
);

plugin CGI => {route => '/env/basic', script => cgi_script('env.cgi'), env => {}};

my $t = Test::Mojo->new;

$t->get_ok('/env/basic/foo?a=1;b=2')->status_is(200)
  ->content_like(qr{^QUERY_STRING=a=1;b=2}m, 'QUERY_STRING with semicolon');

local $TODO = 'mojolicious cannot parse query with semicolon';
is $this_will_mess_up, '1', 'not messed up';

done_testing;