martes, 17 de septiembre de 2013

url-retrieve can't find localhost

Today I found a surprising bug in emacs url package. In fact, I'm not sure where the bug is.

The bug appears when trying to url-retrieve an url on localhost, like:
(url-retrieve "http://localhost:7070/api/services" 
  (lambda (s) (switch-to-buffer (current-buffer))))

The funny thing is that changing localhost to works. Even adding a line " foobar" in my /etc/hosts also fixed it.

No clue why is that,but anyway,  it seems to be fixed in some development branch so I'm going to recompile my to the latest one and see what happens.

1 comentario:

Ahmed Aldebrn Fasih dijo...

I ran across this recently too: see for an explanation. localhost might be getting resolved to an ipv6 address.