Subject: Re: bug#24117: 25.1; url-http-create-request: Multibyte text in HTTP request

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 11 Aug 2016 13:05:12 +0200

Dmitry Gutov <[email-masked]> 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