From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: stakemorii@gmail.com, larsi@gnus.org, 24117@debbugs.gnu.org
Subject: bug#24117: 25.1; url-http-create-request: Multibyte text in HTTP request
Date: Mon, 8 Aug 2016 04:56:58 +0300 [thread overview]
Message-ID: <aa66c872-637c-6739-655b-29796125f7c6@yandex.ru> (raw)
In-Reply-To: <83twf0lb5s.fsf@gnu.org>
Hi Eli,
On 08/04/2016 08:02 PM, Eli Zaretskii wrote:
> Hmm, but url-generic-parse-url is called from gazillion other places,
> so maybe this is not safe.
Only about 40 places, all of them either in lisp/url or lisp/gnus.
Sadly, Lars is being silent on the matter.
It might not be 100% safe, but maybe doing TRT could be enough.
> No, I meant that since RFC 3986 doesn't allow non-ASCII characters,
Indeed.
> and url-generic-parse-url doesn't do anything about that, it is either
> already broken for non-ASCII characters, or already copes with them.
> So we don't need to worry about that.
I imagined that some code that uses the return value of
url-http-create-request might perform the escaping. But that doesn't
seem to be the case, see below.
> However, a safer change would be to do something like this:
>
> (or (not (multibyte-string-p url-http-target-url))
> (setq url-http-target-url
> (decode-coding-string url-http-target-url 'utf-8)))
>
> in url-http-create-request. Can you try this?
I'll try it if you insist, but that choice of encoding seems rather
arbitrary. I think we should go with your previous suggestion: make the
URL parsing buffer unibyte.
But we do try to handle non-ASCII URLs on the level above
url-generic-parse-url. See url-retrieve-internal: one of the first
things it does is (setq url (url-encode-url url)). And only after that,
(setq url (url-generic-parse-url url)).
The URL package doesn't seem to support international domains anyway.
This fails:
(url-retrieve-synchronously "http://банки.рф")
However, the error it fails with is a bit more comprehensible if the URL
parsing buffer is unibyte:
Debugger entered--Lisp error: (error "банки.рф/80 Name or service not
known")
Instead of:
Debugger entered--Lisp error: (error
"\301\220\300\261\301\220\300\260\301\220\300\275\301\220\300\272\301\220\300\270.\301\221\300\200\301\221\300\204/80
Name or service not known")
next prev parent reply other threads:[~2016-08-08 1:56 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-31 8:26 bug#24117: 25.1; url-http-create-request: Multibyte text in HTTP request Sho Takemori
2016-07-31 14:31 ` Eli Zaretskii
2016-07-31 23:21 ` Sho Takemori
2016-08-01 13:17 ` Eli Zaretskii
2016-08-02 0:52 ` Dmitry Gutov
2016-08-02 15:25 ` Eli Zaretskii
2016-08-03 2:39 ` Dmitry Gutov
2016-08-04 17:02 ` Eli Zaretskii
2016-08-08 1:56 ` Dmitry Gutov [this message]
2016-08-08 13:32 ` Ted Zlatanov
2016-08-08 23:48 ` Katsumi Yamaoka
2016-08-08 15:33 ` Eli Zaretskii
2016-08-08 15:52 ` Lars Ingebrigtsen
2016-08-08 15:54 ` Lars Ingebrigtsen
2016-08-08 16:14 ` Eli Zaretskii
2016-08-08 16:18 ` Lars Ingebrigtsen
2016-08-08 16:33 ` Eli Zaretskii
2016-08-08 17:11 ` Andreas Schwab
2016-08-08 17:30 ` Eli Zaretskii
2016-08-08 19:16 ` Andreas Schwab
2016-08-09 2:32 ` Eli Zaretskii
2016-08-09 8:05 ` Andreas Schwab
2016-08-09 14:50 ` Eli Zaretskii
2016-08-10 7:12 ` Dmitry Gutov
2016-08-10 14:35 ` Eli Zaretskii
2016-08-11 2:52 ` Dmitry Gutov
2016-08-11 8:53 ` Ted Zlatanov
2016-08-11 12:31 ` Dmitry Gutov
2016-08-11 12:57 ` Ted Zlatanov
2016-08-11 13:00 ` Lars Ingebrigtsen
2016-08-11 13:18 ` Ted Zlatanov
2017-05-08 13:36 ` Dmitry Gutov
2017-05-08 20:57 ` Lars Ingebrigtsen
2017-05-10 0:40 ` Dmitry Gutov
2016-08-11 11:05 ` Lars Ingebrigtsen
2016-08-11 14:47 ` Eli Zaretskii
2016-08-11 14:59 ` Dmitry Gutov
2016-08-11 15:31 ` Eli Zaretskii
2016-08-11 18:07 ` Dmitry Gutov
2016-08-11 19:47 ` Eli Zaretskii
2016-08-12 21:44 ` John Wiegley
2016-08-13 0:30 ` Sho Takemori
2016-08-13 7:02 ` Eli Zaretskii
2016-08-13 7:31 ` Sho Takemori
2016-08-13 8:31 ` Eli Zaretskii
2016-08-13 13:02 ` Sho Takemori
2016-08-13 13:11 ` Eli Zaretskii
2016-08-13 15:32 ` Dmitry Gutov
2016-08-13 15:56 ` Eli Zaretskii
2016-08-08 16:21 ` Lars Ingebrigtsen
2016-08-08 16:33 ` Eli Zaretskii
2016-08-08 16:58 ` Lars Ingebrigtsen
2016-08-08 17:11 ` Eli Zaretskii
2016-08-08 19:46 ` Dmitry Gutov
2016-08-08 20:19 ` Lars Ingebrigtsen
2016-08-08 20:35 ` Dmitry Gutov
2016-08-08 20:36 ` Lars Ingebrigtsen
2016-08-09 2:13 ` Dmitry Gutov
2016-08-09 9:39 ` Lars Ingebrigtsen
2016-08-10 6:50 ` Dmitry Gutov
2016-08-11 1:31 ` Dmitry Gutov
2016-08-02 3:26 ` Sho Takemori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aa66c872-637c-6739-655b-29796125f7c6@yandex.ru \
--to=dgutov@yandex.ru \
--cc=24117@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=larsi@gnus.org \
--cc=stakemorii@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.