I noticed a "slight" bug in the previous version Net::SSleay-0.9.1c 
generating the HTTPS POST request (post_https). It may be present in the 
new release, I don't know.

The problem I noticed was in the "make_form" logic. In creating the 
key-value pairs for the request, this routine leaves a trailing '=' if the 
last key has no value. MY code was leaving a trailing '=' already. Then 
"make_form" added a second trailing '='.

So, if the string of key-value pairs you pass to "make_form" contains a 
trailing '=', like this:

$cgi_string = 'this=that&now=then&nothing='

Then, "make_form" will leave another '=' at the end, effectively giving 
you:

this = 'that'
now = 'then'
nothing = '='        <- not what I wanted here!

I added the following workaround to my code to hack off any double trailing 
'=' after doing "make_form"...
(Perl code follows)

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
sub do_https_post {
  my $string = make_form ($cgi_string);        #correct trailing '=' bug in 
post_https
  $string =~ s/(.?)(=)=/$1$2/;                 #remove double '=' if 
present

  ($page, $response, %reply_headers)
         = post_https($server, $port, $uri,
            make_headers(
                        'User-Agent' => $user_agent,
                        'Referer'    => $refer_url,
                        'Authorization' => $credentials,
                ),
            $string
         );
}
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Ed Eddington
[EMAIL PROTECTED]
PCR

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to