Re: Post Method Problem

Gisle Aas (gisle@activestate.com)
03 Jan 2001 22:35:39 -0800


"Bernie Aua" <bernie@summum.org> writes:

> form contents to both secure and non-secure URLs. For the most part,
> everything works great. However, I have encountered a problem with a
> specific secure URL. When I submit a form via the POST method to this URL:
> 
> https://ssl.aego.com:443/%ae6e1ee074dabd0da94dc811d4
> 
> I always receive a 500 server error for the response. Using Internet
> Explorer, everything works fine. Upon examining the request header in my
> application, I see this:
> 
> POST https://ssl.aego.com/%AE6e1ee074dabd0da94dc811d4
> 
> It appears LWP has changed the %ae in the URL to %AE. Does anyone know if
> there is a way I can keep LWP from changing this?

This happens because the URI::URL->new always calls:

    $self->[0] = $self->[0]->canonical;

I can't really remember why.  Probably just because this was the
behaviour in the original URI::URL module.  But the fact that the %AE
escape now is upper case is not supposed to matter for the server.

One way to avoid this is to set

   $HTTP::URI_CLASS = "URI";

before you construct any request objects.  This avoids using the
URI::URL module (the default for backwards comptibility).  The URI
class does not do the automatic canonicalization.

Regards,
Gisle