From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ricardo Wurmus Newsgroups: gmane.lisp.guile.bugs Subject: bug#32528: http-post breaks with XML response payload containing boundary Date: Wed, 29 Aug 2018 12:26:02 +0200 Message-ID: <87d0u1bhad.fsf@elephly.net> References: <874lfiltkg.fsf@elephly.net> <87bm9mf9d9.fsf@netris.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1535538553 30231 195.159.176.226 (29 Aug 2018 10:29:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 29 Aug 2018 10:29:13 +0000 (UTC) User-Agent: mu4e 1.0; emacs 26.1 Cc: 32528@debbugs.gnu.org To: Mark H Weaver Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Aug 29 12:29:08 2018 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fuxim-0007iz-AO for guile-bugs@m.gmane.org; Wed, 29 Aug 2018 12:29:08 +0200 Original-Received: from localhost ([::1]:42230 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fuxks-0000Gd-Hz for guile-bugs@m.gmane.org; Wed, 29 Aug 2018 06:31:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fuxkU-0008RG-Td for bug-guile@gnu.org; Wed, 29 Aug 2018 06:30:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fuxgj-0004IC-WA for bug-guile@gnu.org; Wed, 29 Aug 2018 06:27:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59629) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fuxgj-0004I3-RD for bug-guile@gnu.org; Wed, 29 Aug 2018 06:27:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fuxgj-0004ti-K5 for bug-guile@gnu.org; Wed, 29 Aug 2018 06:27:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ricardo Wurmus Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 29 Aug 2018 10:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32528 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 32528-submit@debbugs.gnu.org id=B32528.153553838318778 (code B ref 32528); Wed, 29 Aug 2018 10:27:01 +0000 Original-Received: (at 32528) by debbugs.gnu.org; 29 Aug 2018 10:26:23 +0000 Original-Received: from localhost ([127.0.0.1]:36414 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fuxg6-0004sn-TS for submit@debbugs.gnu.org; Wed, 29 Aug 2018 06:26:23 -0400 Original-Received: from sender-of-o51.zoho.com ([135.84.80.216]:21067) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fuxg4-0004se-J4 for 32528@debbugs.gnu.org; Wed, 29 Aug 2018 06:26:21 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1535538367; cv=none; d=zoho.com; s=zohoarc; b=Q8l+v2E0AJH8rByuFGQ/nWoR3+msqEEUIz4VuBvQq52ofjFRTcHi/YVDyGvLLfJwJLIIr0bQeiPoIZ9DOmdRfXlDHWJtOi4aeu7cJ/Sbm4TuAuswNxsm5f0Wepm9QQLG76hIibae7/5RjupxZW5mFVCfYP8qjkhH/R4sc6AlRZo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1535538367; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=d/oy29hO5eb7uZZ8UHequ9LCUglrW3H40wfG2B7DVn4=; b=PFTaBz6Ld+rrFZLcF+39rFndlhZsfxIe6VzYO4+WDPPtynzv1ju8qYZ9+J/33e+q6oL1xMdt2OuZbhSPGjw0l0Y2rgDbgCG839DWgy1GO00CawYAMJ+gwE3i8/tXP6gNzcLJjbCBG4Rl3ut9AcWEXqotNcVZr1IZAF69FRFARpc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1535538367; s=zoho; d=elephly.net; i=rekado@elephly.net; h=References:From:To:Cc:Subject:In-reply-to:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; l=1262; bh=d/oy29hO5eb7uZZ8UHequ9LCUglrW3H40wfG2B7DVn4=; b=hhJo/spGSBw4Q4c48Hd6K23gWw0gDaxfFS8XelfO9t0mQEYQnMMpG8zUu6wuKziT nRHdP7YQiSe06wUAsuPLtU94ytvRoL8orxRp6nODh/rZNLf05l1eOVFFpfGdsJR7fPb uhXpEfNv4HGcidMsdQc2aFXOLsRKp19/POrlpwg8= Original-Received: from localhost (141.80.245.135 [141.80.245.135]) by mx.zohomail.com with SMTPS id 1535538365105897.2605372086007; Wed, 29 Aug 2018 03:26:05 -0700 (PDT) In-reply-to: <87bm9mf9d9.fsf@netris.org> X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC X-ZohoMailClient: External X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:9140 Archived-At: Hi Mark, > Ricardo Wurmus writes: > [=E2=80=A6] >> 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 =E2=80=9Cwget --save-headers=E2= =80=9D after sending the bug report and noticed the offending header like you did: > Content-Type: multipart/related; type=3D"text/xml"; start=3D""; boundary=3D"=3D-=3D-=3D" > > 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 '=3D' 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 =E2=80=9C=3D=E2=80=9D in the string part. > I'll work on a proper parser for Content-Type headers. Thanks! -- Ricardo