From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: stakemorii@gmail.com, Lars Magne Ingebrigtsen <larsi@gnus.org>,
24117@debbugs.gnu.org
Subject: bug#24117: 25.1; url-http-create-request: Multibyte text in HTTP request
Date: Wed, 3 Aug 2016 05:39:31 +0300 [thread overview]
Message-ID: <27168f12-32d2-cb38-45c0-27d3339c75aa@yandex.ru> (raw)
In-Reply-To: <83mvkvmbv2.fsf@gnu.org>
On 08/02/2016 06:25 PM, Eli Zaretskii wrote:
> How about making the temporary buffer parsed by url-generic-parse-url
> a unibyte buffer? Does that fix the problem?
It does fix anaconda-mode, yes.
> AFAIU, RFC 3986 doesn't
> allow non-ASCII characters, so we should be okay handling that in a
> unibyte buffer, right?
I don't really know. RFC 3986 or not, I suppose in practice the url
could be quoted before or after it's parsed. And url-parse-tests.el
doesn't specify this case.
Lars, what do you think?
> I mean something like this:
>
> (with-temp-buffer
> ;; Don't let those temp-buffer modifications accidentally
> ;; deactivate the mark of the current-buffer.
> (let ((deactivate-mark nil))
> (set-syntax-table url-parse-syntax-table)
> (erase-buffer)
> (set-buffer-multibyte nil) ;; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> (insert url)
> (goto-char (point-min))
> ...
Heh, that's exactly where I added the line, without looking at your code.
> As for other possible problems like that, are there any that could be
> expected already? If so, we could try fixing them now.
Nothing else jumps out so far. The function depends on quite a few
global variables. To be really certain, we'd have to trace how all of
them are created, and for all that are not directly bound by the user,
the chains of calls that produce them.
> Alternatively, we could just wait for them to come up;
I'm worried about having a problem crop up in some significant use case
after we release 25.1. That doesn't feel very probable, but still.
> after all,
> catching those was the main rationale for introducing the length test,
> right?
The most important part was to make sure that the length of the body in
bytes is equal to the value of the Content-Length header (the difference
caused actual problems).
But then we decided to make the check wider and test that the whole
request string is unibyte-ish. Which made sense, but seems to be working
out less well than we expected.
next prev parent reply other threads:[~2016-08-03 2:39 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 [this message]
2016-08-04 17:02 ` Eli Zaretskii
2016-08-08 1:56 ` Dmitry Gutov
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=27168f12-32d2-cb38-45c0-27d3339c75aa@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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).