GNU bug report logs - #32528
http-post breaks with XML response payload containing boundary

Previous Next

Package: guile;

Reported by: Ricardo Wurmus <rekado <at> elephly.net>

Date: Sat, 25 Aug 2018 08:50:02 UTC

Severity: normal

Full log


Message #14 received at 32528 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Mark H Weaver <mhw <at> netris.org>
Cc: 32528 <at> debbugs.gnu.org
Subject: Re: bug#32528: http-post breaks with XML response payload containing
 boundary
Date: Wed, 29 Aug 2018 12:26:02 +0200
Hi Mark,

> Ricardo Wurmus <rekado <at> elephly.net> writes:
>
[…]
>> The reason why it fails is that Guile processes the response and treats
>> the *payload* contained in the XML response as HTTP.
>
> No, this was a good guess, but it's not actually the problem.

You are right.  I also ended up trying with “wget --save-headers” after
sending the bug report and noticed the offending header like you did:

>   Content-Type: multipart/related; type="text/xml"; start="<main_envelope>"; boundary="=-=-="
>
>   <?xml [...]

I assumed it was part of the payload when it really was a regular
header after all.

> The problem is simply that our Content-Type header parser is broken.
> It's very simplistic and merely splits the string wherever ';' is found,
> and then checks to make sure there's only one '=' in each parameter,
> without taking into account that quoted strings in the parameters might
> include those characters.

Right.  I worked around this in guile-debbugs simply by replacing the
Content-Type header parser with one that lacks the check for the unique
“=” in the string part.

> I'll work on a proper parser for Content-Type headers.

Thanks!

--
Ricardo





This bug report was last modified 5 years and 356 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.