httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From achim settelmeier <set...@netpioneer.de>
Subject Patch: overwrite parameters
Date Fri, 24 Aug 2001 16:20:54 GMT
Hi,

I encountered a rather non-obvious problem with the most recent version of
libapreq found on CPAN (0.33).


SYMPTOM
  If the browser sends parameters to your script using POST-style as well as
URL-style (you know, that ?parm=val&parm2=val2 thing that method="get" uses,
too) parameter passing, the URL-style parameters take precedence over the
POST ones. 


WHY THIS IS A PROBLEM
  libapreq's behaviour is exactly the opposite of what CGI.pm is doing and 
thus causes some problems many old scripts that run as CGI and mod_perl.


INTERNAL
  As far as I can see, the internal handling of parameter looks like this: 
Put every key/value pair found into a list, don't care about dupes. 
When a lookup is done, the value of the first matching key is returned.
URL-style parameters are parsed first (see apache_request.c, line 278+,
subrout ApacheRequest___parse(req)).


PATCH
  The patch is rather simple and is attached to this mail. In subrout
split_to_params, the patch replaces ap_table_add with ap_table_set in 
case the key is already present.


bye,
  Settel


Mime
View raw message