Why isn't url-http-end-of-headers set correctly when using url-automatic-caching?

url
2017-05-19 16:18:21

This is a follow-up question to How can I make url.el work with the If-None-Match header?

Evaluate the following form:

(let ((url-request-method "GET")

(url-automatic-caching t))

(with-current-buffer

(url-retrieve-synchronously

"https://api.github.com/users/octocat")

(message "'%c' (%S)"

(char-after url-http-end-of-headers)

url-http-end-of-headers)))

It thinks url-http-end-of-headers is position 1 in the following buffer:

HTTP/1.1 200 OK

Server: GitHub.com

Date: Fri, 19 May 2017 12:18:32 GMT

Content-Type: application/json; charset=utf-8

Transfer-Encoding: chunked

Status: 200 OK

X-RateLimit-Limit: 60

X-RateLimit-Remaining: 55

X-RateLimit-Reset: 1495197406

Cache-Control: public, max-age=60, s-maxage=60

Vary: Accept

ETag: W/"d093767a41c43cbc64dcc3bda1b5880f"

Last-Modified: Wed, 17 May 2017 21:18:07 GMT

X-GitHub-Media-Type: github.v3; format=json

Access-Control-Expose-Headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit,

  • This seems to be a bug in emacs at url-cache-extract with its use of erase-buffer and wooing out that marker. More details when I'm not mobile. I'll be submitting a bug report :-)

    2017-05-19 16:31:47