Gisle Aas <[EMAIL PROTECTED]> writes:

> Matt Christian <[EMAIL PROTECTED]> writes:
>
>> I originally sent this patch about a year ago* but it never made it into
>> libwww-perl and no one followed up or replied to my original message.
>
> That sometimes happen.  Sorry about that and thanks for not giving
> up!

Yes, I'm glad it got onto your radar screen this time.

> This patch kills the Content-Length both for the request itself and
> for the multipart/* parts.  I think only the later is what you really
> want.
>
> I think the better fix is to simply remove the content-length for the
> parts.  There is probably nothing that really requires them, even
> though they ought to be harmless.

Yes, that was on purpose.  The broken web server I need to interact with
doesn't understand Content-Length for the request or multipart/* parts.
If I send *any* Content-Length headers, it dies with a 5xx error.

I realize that fixing the broken web server would be ideal but
unfortunately in this case the people running it won't budge.  They
don't see it as an issue to fix since "Internet Explorer doesn't have a
problem".

> I don't want really want to introduce yet another ugly global.

I don't like the ugly global either so I'm open to suggestions on how to
better handle it.  Maybe add another option to
LWP::UserAgent->new(%options) ?  Would that be preferred?

> The content-length headers for parts could potentially be useful for
> applications that might abort reading bigger uploads than their policy
> allow after just seeing the headers.  Without these headers they have
> to receive read lots of data in order to discover that it is too much.
> If no "real" browser sends such a header then probably no server app
> look at the header either. Any other opinions on this?

That's the issue with this web server: it only expects what a "real"
browser sends, not what is allowed by the RFCs.  Unfortunately not
everyone plays by the RFCs but rather by what a specific browser sends.

>> I am still using this patch and need to apply it to every new libwww-perl
>> that comes out so I am sending the (updated) patch again...
> [...] 
>> Attached is a patch for libwww-perl, specifically the
>> HTTP/Request/Common.pm module to support not sending the Content-Length
>> header in the MIME chunk for file uploads.  This is accomplished through
>> a new (exportable) variable "$NO_LENGTH_FILE_UPLOAD" and done to support
>> certain old/broken web servers that can't handle the Content-Length header.
>> 
>> (Unified) Patch for HTTP/Request/Common.pm
> [...] 

What are the chances of a (possibly modified) version of my patch making
it into libwww-perl proper?  I'm open to suggestions...

Thanks,

Matt

-- 
Matt Christian  [EMAIL PROTECTED]  Learn to love and love to learn.
http://www.visi.com/~mattc/ 0111 ftp://ftp.visi.com/users/mattc/
5468652073656372657420697320131b331b2e1b311b341b311b351b39110d0a

Reply via email to