Skip to content

Commit 8b3f03f

Browse files
committed
For [GH #184] - show better error diag when POST parameters and QUERY_STRING conflicts
1 parent fcf43b1 commit 8b3f03f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Lite/WebMVC0/Connection.pm

+2-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,8 @@ sub convert_array_param_psgi {
373373
my $qs = $glob->parse_nested_query([$req->query_parameters->flatten]);
374374
foreach my $key (keys %$qs) {
375375
if (exists $body->{$key}) {
376-
die $glob->error("Attempt to overwrite post param '%s' by qs"
376+
die $glob->error("Attempt to overwrite a POST parameter '%s'"
377+
. " by the same one in QUERY_STRING"
377378
, $key);
378379
}
379380
$body->{$key} = $qs->{$key};

Lite/WebMVC0/SiteApp.pm

+4-2
Original file line numberDiff line numberDiff line change
@@ -332,11 +332,13 @@ sub call {
332332
, path_info => $env->{PATH_INFO}
333333
, $self->connection_quad([$virtdir, $loc, $file, $trailer])
334334
, $is_index ? (is_index => 1) : ()
335-
, is_psgi => 1, cgi => $req);
335+
, is_psgi => 1);
336336

337-
my $con = $self->make_connection(undef, @params, yatt => $dh, noheader => 1);
337+
local $CON = my $con = $self->make_connection(undef, @params, yatt => $dh, noheader => 1);
338338

339339
my $error = catch {
340+
$CON->configure(cgi => $req);
341+
340342
$self->run_dirhandler($dh, $con, $file);
341343
};
342344

0 commit comments

Comments
 (0)