Subject: Re: bug#13598: 24.3.50; url-http.el doesn't correctly parse headers when they are sent line-by-line

From: [email-masked] (Jonas Hörsch)
Date: Thu, 07 Feb 2013 19:13:40 +0100

On Thu, Jan 31 2013, Jonas Hoersch wrote:

> changing the regex in (re-search-forward "^\r*$" nil t) to "^\r*\n"
> solves the problem for me, but i'm unsure about what i might possibly be
> breaking that way.

i'm positive now, that changing the regex to "^\r+$" is the way to go.

i would be happy to supply a patch, but i understand it is probably to
trivial a matter to justify going through the legal requirements first.

the following advice can serve as a hotfix:

(defadvice url-http-wait-for-headers-change-function (around
                                                      url-http-properly-wait-for-headers-advice
                                                      activate)
  (save-excursion
    (goto-char (point-min))
    (if (re-search-forward "^\r+$" nil t)
        ad-do-it
      (url-http-debug "Incomplete headers...: %d" (point-max)))))