From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#24117: 25.1; url-http-create-request: Multibyte text in HTTP request Date: Thu, 11 Aug 2016 13:05:12 +0200 Message-ID: References: <83popsocg8.fsf@gnu.org> <7fb3540a-7b74-68cf-2c63-66474de26640@yandex.ru> <83mvkvmbv2.fsf@gnu.org> <27168f12-32d2-cb38-45c0-27d3339c75aa@yandex.ru> <83twf0lb5s.fsf@gnu.org> <83lh07i6g3.fsf@gnu.org> <83k2fri5kc.fsf@gnu.org> <87oa53i3si.fsf@linux-m68k.org> <83bn13i2x2.fsf@gnu.org> <87fuqfhy0q.fsf@linux-m68k.org> <837fbqise6.fsf@gnu.org> <834m6uhu87.fsf@gnu.org> <65f6508f-a464-7f66-fd14-1372dce86aa7@yandex.ru> <83bn10hetr.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1470913633 30698 195.159.176.226 (11 Aug 2016 11:07:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 11 Aug 2016 11:07:13 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cc: stakemorii@gmail.com, schwab@linux-m68k.org, 24117@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 11 13:06:24 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1bXnob-0006vR-6X for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 Aug 2016 13:06:21 +0200 Original-Received: from localhost ([::1]:47588 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXnoY-0000rs-3H for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 Aug 2016 07:06:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXnoM-0000q7-FY for bug-gnu-emacs@gnu.org; Thu, 11 Aug 2016 07:06:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXnoI-0002Oa-D7 for bug-gnu-emacs@gnu.org; Thu, 11 Aug 2016 07:06:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXnoI-0002OO-9j for bug-gnu-emacs@gnu.org; Thu, 11 Aug 2016 07:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bXnoI-0008VY-3e for bug-gnu-emacs@gnu.org; Thu, 11 Aug 2016 07:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Aug 2016 11:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24117 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24117-submit@debbugs.gnu.org id=B24117.147091355632690 (code B ref 24117); Thu, 11 Aug 2016 11:06:02 +0000 Original-Received: (at 24117) by debbugs.gnu.org; 11 Aug 2016 11:05:56 +0000 Original-Received: from localhost ([127.0.0.1]:53038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXnoC-0008VC-0l for submit@debbugs.gnu.org; Thu, 11 Aug 2016 07:05:56 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:36101) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXnoA-0008V4-I3 for 24117@debbugs.gnu.org; Thu, 11 Aug 2016 07:05:54 -0400 Original-Received: from cm-84.215.1.64.getinternet.no ([84.215.1.64] helo=stories) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1bXno7-0008EM-J3; Thu, 11 Aug 2016 13:05:53 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEWPosIvNFZZaJIPDBTm 7fQdHC5oSeU0AAACUklEQVQ4jV2Uy3rjIAxGZT66t4jZg5rum6rsicfdhxC9/6uMhHPpDFkk0bGk XxcMIVBGDBgbImbaHgcIQAGKDBDSsMbmIQf9r3Y9Sih7tZ9FFkj6yXGAaGBW8CZyhZky5d2+eymw wKChQ9zjoPRSxG8V1WCAREpDwnYQYVm2tXNpYFqkCyZVp45cbtsPcxEFFIWb2sHliJ2v27sCBAzU egkA5Ex5VHDgFgiQKJqDfmEjjD1sh4b6oHakF0wuS5NG2cBHQDLwYZ5ZtDFN3UQ2R4HQQogZrg7n mEzZcaXY2YA59Abkp7lOUZaakboCCWRNsfYncFEuW1qjhVIHClll5+Srgrb5msMd2NESNwPia8oE mbQSssJtEgMslVArz+1hNWB6LzpXBagi/WPS1WZ2HRPHrOC1Atrp0nQkYB7zb9CZFWwDhH9AL/P4 hTb4J6iaYn/OwOk30L4l0wK2GumlSrQHmO6gX55gFZ1hmf0dfL48ik6dAx036FJ6gV+hTG9QwIU7 p2f2GCbmE3n1YBY+HZ9JgvvgL6c5SmdNc31m2cA7DyO5rp0ucfKvVg5eBhg3J/j/AI/rpPAJKGl7 16lc3DnBiviQcNaFArc4Xs5wXukJqkUAvzomWN6OK7a9nPrOBhy7Xv2Sz9CaNbNOIylC5uTeLnOE ySTXMULTCZHj4XSlaPcwwaQ3dycaavq53chqlOR0H1NWwAPQfBvzkhnG6Q9wm773V0MadjpYLL2r 0+efb4gWyjx0883uQHRf+gnvoTy44XBKwOOUbu+MoGDX+wV/AZfg1K2OOBawAAAAAElFTkSuQmCC In-Reply-To: (Dmitry Gutov's message of "Thu, 11 Aug 2016 05:52:42 +0300") 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-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:122064 Archived-At: Dmitry Gutov writes: > This one seems more conservative, but it'll require a manual merge to > master. The other one is very trivial, will merge automatically, but > might cause problems for potential less-careful uses of > url-generic-parse-url. Yes, the fix here should be in url-http-create-request, not in the URL parsing functions. The main issue here is that the URL request buffer is a multibyte buffer and (as with all network connection buffers), it shouldn't be. (Or, rather, that function just creates a string instead of a buffer, but the same principle applies.) But I think this fix looks OK: > - (host (url-host url-http-target-url)) > + (host (url-http--encode-string (url-host url-http-target-url))) > (auth (if (cdr-safe (assoc "Authorization" url-http-extra-headers)) (etc) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no