Re: Bug in HTTP::Request::Common CHECK_BOUNDARY ?

Antoine Bertier (antoine.bertier@axa.com)
Fri, 18 Jun 1999 18:47:49 +0200


"Randal L. Schwartz" wrote:

> >>>>> "Antoine" == Antoine Bertier <antoine.bertier@axa.com> writes:
>
> Antoine> Hello,
> Antoine> I have problems with using HTTP::Request::Common to post files on a web
> Antoine> site. It seems that the selected boundary (000 by default) is not
> Antoine> checked correctly for existence in the transmitted parts. Since 000 is
> Antoine> often found in HTML files as a color specification this causes problems.
>
> Antoine> I think in CHECK_BOUNDARY the check must be on $boundary  not on
> Antoine> "--$boundary" which is the boundary line the standard specifies and not
> Antoine> the boundary itself.
>
> Antoine> So I would suggest to replace:
> Antoine>   if (index($_, "--$boundary") >= 0) {
> Antoine> by
> Antoine>   if (index($_, "$boundary") >= 0) {
>
> I suppose this would be to work around a *broken* webserver that
> *incorrectly* triggered when $boundary was seen (a violation of RFCs),
> rather than when "--$boundary" was seen.
>
> Why don't you post the name of the broken webserver?  Then we can
> decide how bad the problem is worth working around. :)
>

Well it seems to be Netscape Enterprise Server 3.6 SP1 :-(

I was trying to automate the upload of web pages on my home page on sites.netscape.net
or sites.netscape.com (the Netcenter hosted home pages) and saw my pages cut off at
the color="#000 level.

I must say I find the RFC could be clearer on the topic since it is easy to get
confused by paragraphs such as:

   Boundary delimiters must not appear within the encapsulated material,
   and must be no longer than 70 characters, not counting the two leading hyphens.

and by the subtle distinction between boundary delimiter, boundary parameter and
boundary delimiter line.

However the BNF seems non ambiguous so it looks more like a bug on the Netcenter
server!

Thanks for your help!

Antoine.

>
> --
> Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
> Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
> Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
> Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
> Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me