unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Christian Henz" <ChrHenz@gmx.net>
To: help-gnu-emacs@gnu.org
Subject: Problem with url-retrieve-synchronously and HTTP header
Date: Fri, 7 Feb 2014 00:23:25 +0100 (CET)	[thread overview]
Message-ID: <trinity-fa810e85-622b-4495-b299-dec0e718bfd9-1391729005731@3capp-gmx-bs25> (raw)

In emacs 23.4.1, I'm trying to access a local web service (written in Python/Flask), but "url-retrieve-synchronously" does not properly process the HTTP header returned.

When I retrieve google.com (among other sites), it works as expected:

    (switch-to-buffer (url-retrieve-synchronously "http://google.com"))
    HTTP/1.1 200 OK
    Date: Thu, 06 Feb 2014 22:15:10 GMT
    [...]

When I retrieve my local URL, the header is not parsed/cleaned correctly:

    (switch-to-buffer (url-retrieve-synchronously "http://127.0.0.1:5000"))
    HTTP/1.0 200 OK
    Content-Type: text/plain; charset=UTF-8^M
    [...]

Only the first line was "cleaned" by converting "\r\n" -> "\n". "url-http-end-of-headers" then consequently points to the "\n" after "OK".

When I dump the header using curl, it looks correct to me:

    HTTP/1.0 200 OK\r\n
    Content-Type: text/plain; charset=UTF-8\r\n
    [...]

I also remember this working as expected on another machine with the same local service, but emacs 22...

Does anyone know what the problem might be?

Cheers,
Christian



             reply	other threads:[~2014-02-06 23:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-06 23:23 Christian Henz [this message]
2014-02-07 12:47 ` Aw: Problem with url-retrieve-synchronously and HTTP header Christian Henz

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=trinity-fa810e85-622b-4495-b299-dec0e718bfd9-1391729005731@3capp-gmx-bs25 \
    --to=chrhenz@gmx.net \
    --cc=help-gnu-emacs@gnu.org \
    /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.
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).