Ed Eddington <[EMAIL PROTECTED]> writes:
> 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¬hing='
>
> Then, "make_form" will leave another '=' at the end, effectively giving
> you:
>
> this = 'that'
> now = 'then'
> nothing = '=' <- not what I wanted here!
Sorry, but I do not understand what you mean. make_form() never eats
input in format of your $cgi_string, albeit it attempts to produce
that. It eats "hash like" list of name value pairs. If the list has
odd number of elements then the last name is dealt with as having
empty value. Please provide a snippet demonstrating the problem.
>
> 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
You go wrong here. If you already have your CGI string formatted, you do
not need make_form(). make_form() is precisely used to format cgi strings,
like this:
$cgi_string = make_form('this'=>'that', 'now'=>'then', 'nothing'=>'');
You basically got the right idea on make_headers().
>
> ($page, $response, %reply_headers)
> = post_https($server, $port, $uri,
> make_headers(
> 'User-Agent' => $user_agent,
> 'Referer' => $refer_url,
> 'Authorization' => $credentials,
> ),
> $string
> );
> }
--Sampo
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]