emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] url: Wrap cookie headers in url-http--encode-string.


From: Toke Høiland-Jørgensen
Subject: Re: [PATCH] url: Wrap cookie headers in url-http--encode-string.
Date: Wed, 07 Sep 2016 20:25:07 +0200

Eli Zaretskii <address@hidden> writes:

>> From: Toke Høiland-Jørgensen <address@hidden>
>> Date: Wed, 07 Sep 2016 18:52:15 +0200
>> Cc: address@hidden
>> 
>> Right, well, I'm not actually sure that there's any multibyte *content*
>> in the cookie header. But somehow, without this patch, if there's an
>> UTF-8 payload, (string-bytes request) returns an extra byte for each
>> UTF-8 octet. I have no idea why that is; basically, what I would see was:
>> 
>> (string-bytes url-http-data) == (length url-http-data)
>> 
>> but
>> 
>> (string-bytes (substring request (* -1 (length (url-http-data))))) being
>> two bytes longer (for a single UTF-8 character in the payload).
>
> Can you show a test case where this happens?

Appears to be any request with an UTF-8 encoded payload that goes
to a host that has cookies stored.

This snippet triggers the error for me if I replace example.org with a
domain that has cookies stored in ~/.emacs.d/url/cookies:

(let* ((url-request-data (encode-coding-string "æøå" 'utf-8)))
       (url-retrieve-synchronously "http://example.org";))

-Toke



reply via email to

[Prev in Thread] Current Thread [Next in Thread]