From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: [PATCH] http-client: Support basic authentication. Date: Wed, 16 Dec 2015 11:51:15 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a99g8-0002G1-W4 for guix-devel@gnu.org; Wed, 16 Dec 2015 05:51:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a99g5-0002Cx-JS for guix-devel@gnu.org; Wed, 16 Dec 2015 05:51:28 -0500 Received: from sinope.bbbm.mdc-berlin.de ([141.80.25.23]:34407) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a99g5-0002Cm-Aa for guix-devel@gnu.org; Wed, 16 Dec 2015 05:51:25 -0500 Received: from localhost (localhost [127.0.0.1]) by sinope.bbbm.mdc-berlin.de (Postfix) with ESMTP id C90DA280AB0 for ; Wed, 16 Dec 2015 11:51:22 +0100 (CET) Received: from sinope.bbbm.mdc-berlin.de ([127.0.0.1]) by localhost (sinope.bbbm.mdc-berlin.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fc9abjZarsxQ for ; Wed, 16 Dec 2015 11:51:16 +0100 (CET) Received: from HTCAONE.mdc-berlin.net (mab.citx.mdc-berlin.de [141.80.36.102]) by sinope.bbbm.mdc-berlin.de (Postfix) with ESMTP for ; Wed, 16 Dec 2015 11:51:16 +0100 (CET) In-Reply-To: List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: "guix-devel@gnu.org" I sent this patch after making a tiny untested change, which broke http-fetch unexpectedly. This does not work: (let*-values ((auth-header (match (uri-userinfo uri) ((str) (cons 'Authorization (string-append "Basic " (base64-encode (string->utf8 str))))= ) (_ '()))) ...) ...) With that I get this error: web/request.scm:183:10: In procedure build-request: web/request.scm:183:10: Bad request: Header not a pair: () Binding the result of (uri-userinfo uri) fixes it: (let*-values ((userinfo (uri-userinfo uri)) (auth-header (match userinfo ((str) (cons 'Authorization (string-append "Basic " (base64-encode (string->utf8 str))))= ) (_ '()))) ...) ...) I don=E2=80=99t understand this. Does (uri-userinfo uri) return multiple values? ~~ Ricardo