W3C home > Mailing lists > Public > www-validator@w3.org > September 1999

Re: [PATCH] use CGI.pm;

From: Matthew Wickline <listbox@wickline.org>
Date: Wed, 29 Sep 1999 06:02:43 -0500
To: Gerald Oskoboiny <gerald@w3.org>
Cc: Terje Bless <link@tss.no>, W3C Validator <www-validator@w3.org>
Message-id: <01JGJ66D568299DHFE@kids.wustl.edu>
gerald@w3.org, 1999_09_28:
> It wants '=' after the parameters


I haven't tested this code, so pardon typos :) What if you
pre-process the query string before cgi.pm gets called?
Kinda like:

    BEGIN {
        $ENV{QUERY_STRING}
            =~ s/(^|\G)([^;&]+)([;&]|$)/$2=$3/g;
    }
    use CGI qw(:cgi -newstyle_urls -private_tempfiles);

Above won't work for POSTs. Does anyone use POST to call
the validator? I suppose that sort of strategy could be
finessed to work with POSTS as well, if necessary. Just
pre-process any post request until it looks like a 
(properly munged) GET request by the time it gets to
cgi.pm

If that works, perhaps that old funky style of passing
parameters in the PATH_INFO could be supported by changing
the above BEGIN block to something like:

    BEGIN {
        if (
            length( $ENV{PATH_INFO} )
            and not
            length( $ENV{QUERY_STRING} )
        ) {
            ( $ENV{QUERY_STRING} = $ENV{PATH_INFO} )
                =~ s|/|;|g
        }
        $ENV{QUERY_STRING}
            =~ s/(?<=^|[;&])([^;&]+)([;&]|$)/$1=$2/g;
    }

-matt
Received on Wednesday, 29 September 1999 07:02:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:13:52 GMT