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 20:20:30 +0300 Message-ID: <83oa3y8g0x.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> 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 1473355351 30961 195.159.176.226 (8 Sep 2016 17:22:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 8 Sep 2016 17:22:31 +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 19:22:27 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 1bi31n-0006ku-Oy for ged-emacs-devel@m.gmane.org; Thu, 08 Sep 2016 19:22:19 +0200 Original-Received: from localhost ([::1]:49732 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi31l-0004iB-KU for ged-emacs-devel@m.gmane.org; Thu, 08 Sep 2016 13:22:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi30T-0003ha-GC for emacs-devel@gnu.org; Thu, 08 Sep 2016 13:20:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bi30O-0002wV-VP for emacs-devel@gnu.org; Thu, 08 Sep 2016 13:20:56 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60744) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi30O-0002wK-S8; Thu, 08 Sep 2016 13:20:52 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3274 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bi30L-0007sQ-RN; Thu, 08 Sep 2016 13:20:51 -0400 In-reply-to: <87a8fiidso.fsf@toke.dk> (message from Toke =?utf-8?Q?H=C3=B8?= =?utf-8?Q?iland-J=C3=B8rgensen?= on Thu, 08 Sep 2016 17:58:31 +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:207291 Archived-At: > From: Toke Høiland-Jørgensen > Cc: Eli Zaretskii , monnier@iro.umontreal.ca, emacs-devel@gnu.org > Date: Thu, 08 Sep 2016 17:58:31 +0200 > > (url-retrieve-synchronously "http://google.se") ; sets a cookie > (let* ((url-request-data (encode-coding-string "æøå" 'utf-8))) > (url-retrieve-synchronously "http://google.se")) ; crashes Can the cookies file include non-ASCII text? E.g., could the domain be non-ASCII? 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. Btw, if the cookies file can indeed include non-ASCII characters, IMO url-cookie needs to take more care of forcing specific encoding when it reads and writes that file, otherwise this is a problem waiting to happen. But we can solve this on master, if needed; the urgent thing is to fix the release branch for this particular use case. Thanks.