[Top][All Lists]

[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 18:52:15 +0200

Stefan Monnier <address@hidden> writes:

>> In some cases the output of url-cookie-generate-header can be multibyte,
> Hmmm... I think this is a problem in itself. So rather than encode the
> result of url-cookie-generate-header-lines, we should change
> url-cookie-generate-header-lines so that it always returns a unibyte
> string.

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)


(string-bytes (substring request (* -1 (length (url-http-data))))) being
two bytes longer (for a single UTF-8 character in the payload).


reply via email to

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