From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alain Schneble Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] url: Wrap cookie headers in url-http--encode-string. Date: Thu, 8 Sep 2016 22:29:47 +0200 Message-ID: <86wpimqgn8.fsf@realize.ch> References: <20160907153014.15752-1-toke@toke.dk> <87inu7k5z4.fsf@toke.dk> <83bmzzaawr.fsf@gnu.org> <877fank1oc.fsf@toke.dk> <87inu6iim8.fsf@toke.dk> <2563921f-d20d-753b-09eb-c8671bc5b6d6@yandex.ru> <87a8fiidso.fsf@toke.dk> <83oa3y8g0x.fsf@gnu.org> <83k2em8dzs.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1473366656 21296 195.159.176.226 (8 Sep 2016 20:30:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 8 Sep 2016 20:30:56 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (windows-nt) Cc: toke@toke.dk, dgutov@yandex.ru, Stefan Monnier , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 08 22:30:50 2016 Return-path: Envelope-to: ged-emacs-devel@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 1bi5y7-0004Jl-LJ for ged-emacs-devel@m.gmane.org; Thu, 08 Sep 2016 22:30:43 +0200 Original-Received: from localhost ([::1]:54056 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi5y5-0004ue-M1 for ged-emacs-devel@m.gmane.org; Thu, 08 Sep 2016 16:30:41 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48196) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi5xz-0004uX-A8 for emacs-devel@gnu.org; Thu, 08 Sep 2016 16:30:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bi5xx-0008MK-4e for emacs-devel@gnu.org; Thu, 08 Sep 2016 16:30:34 -0400 Original-Received: from clientmail.realize.ch ([46.140.89.53]:2765) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1bi5xs-0008LV-0w; Thu, 08 Sep 2016 16:30:28 -0400 Original-Received: from rintintin.hq.realize.ch.lan.rit ([192.168.0.105]) by clientmail.realize.ch ; Thu, 8 Sep 2016 22:30:13 +0200 Original-Received: from MYNGB (192.168.66.64) by rintintin.hq.realize.ch.lan.rit (192.168.0.105) with Microsoft SMTP Server (TLS) id 15.0.516.32; Thu, 8 Sep 2016 22:29:53 +0200 In-Reply-To: <83k2em8dzs.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 08 Sep 2016 21:04:23 +0300") X-ClientProxiedBy: rintintin.hq.realize.ch.lan.rit (192.168.0.105) To rintintin.hq.realize.ch.lan.rit (192.168.0.105) X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] X-Received-From: 46.140.89.53 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:207304 Archived-At: Eli Zaretskii writes: >> From: Stefan Monnier >> Cc: Toke H=F8iland-J=F8rgensen , >> dgutov@yandex.ru, emacs-devel@gnu.org >> Date: Thu, 08 Sep 2016 13:47:46 -0400 >>=20 >> > If that file is guaranteed to be pure ASCII, we can indeed force the >> > string returned by url-cookie-generate-header to be unibyte. >> > Otherwise we need to encode it. >>=20 >> AFAIK the cookie data is "sequence of bytes", i.e. not "pure ASCII". > > Not according to my reading of the Wikipedia, but maybe that is > inaccurate. FWIW, Mozilla refers to RFC6265 https://tools.ietf.org/html/rfc6265#section-5.4: Bottom of Page 26 says: NOTE: Despite its name, the cookie-string is actually a sequence of octets, not a sequence of characters. To convert the cookie-string (or components thereof) into a sequence of characters (e.g., for presentation to the user), the user agent might wish to try using the UTF-8 character encoding [RFC3629] to decode the octet sequence. This decoding might fail, however, because not every sequence of octets is valid UTF-8. See also https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cookie.