From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] url: Wrap cookie headers in url-http--encode-string. Date: Thu, 08 Sep 2016 21:01:39 +0300 Message-ID: <83lgz28e4c.fsf@gnu.org> 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> <871t0ui8xe.fsf@toke.dk> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1473357756 28330 195.159.176.226 (8 Sep 2016 18:02:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 8 Sep 2016 18:02:36 +0000 (UTC) Cc: emacs-devel@gnu.org, monnier@iro.umontreal.ca, dgutov@yandex.ru To: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 08 20:02:30 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 1bi3eZ-0005pC-0d for ged-emacs-devel@m.gmane.org; Thu, 08 Sep 2016 20:02:23 +0200 Original-Received: from localhost ([::1]:50148 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi3eW-0001tR-Tm for ged-emacs-devel@m.gmane.org; Thu, 08 Sep 2016 14:02:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi3eF-0001mE-OV for emacs-devel@gnu.org; Thu, 08 Sep 2016 14:02:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bi3eA-0004cL-TF for emacs-devel@gnu.org; Thu, 08 Sep 2016 14:02:02 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33009) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi3eA-0004cH-Ps; Thu, 08 Sep 2016 14:01:58 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3699 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bi3e9-0006MS-3e; Thu, 08 Sep 2016 14:01:58 -0400 In-reply-to: <871t0ui8xe.fsf@toke.dk> (message from Toke =?utf-8?Q?H=C3=B8?= =?utf-8?Q?iland-J=C3=B8rgensen?= on Thu, 08 Sep 2016 19:43:41 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:207292 Archived-At: > From: Toke Høiland-Jørgensen > Cc: dgutov@yandex.ru, monnier@iro.umontreal.ca, emacs-devel@gnu.org > Date: Thu, 08 Sep 2016 19:43:41 +0200 > > > Can the cookies file include non-ASCII text? E.g., could the domain > > be non-ASCII? > > >From glancing at the code, it seems those are the non-puny-coded > hostnames that are stored in that file. But that doesn't really matter, > as those are only lookup variables in an the array. According to this: https://en.wikipedia.org/wiki/HTTP_cookie a cookie response could include "Domain=example.com", which I read to mean the domain can appear in the response for a cookie. Am I mistaken? > The question is whether the cookie values themselves can be. The same Wikipedia article says no: The value of a cookie may consist of any printable ASCII character (! through ~, Unicode \u0021 through \u007E) excluding , and ; and whitespace characters. The name of a cookie excludes the same characters, as well as =, since that is the delimiter between the name and value. The cookie standard RFC 2965 is more restrictive but not implemented by browsers. So AFAIU, the only problem is the domain name (and maybe also Path).