Erlang Mailing Lists

Author Message

<  Erlang patches mailing list  ~  tiny http-auth improvement for http-client

Guest
Posted: Sun Mar 04, 2007 2:29 pm Reply with quote
Guest
Hello everyone.

HTTP-client could not perform HTTP-Auth with weird user or password,
i.e. when password contains "/" symbol:

igor@indigo:~/http-client% erl
Erlang (BEAM) emulator version 5.5.3 [source] [async-threads:0] [kernel-poll:false]

Eshell V5.5.3 (abort with ^G)
1> http:request(get, {"http://igor:ac/dc@www.goryachev.org/photos/", []}, [], []).
{error,{malformed_url,"http://igor:ac/dc@www.goryachev.org/photos/"}}

I added an extra http option (#http_options{http_auth, % {User,
Password} = {string(), string()}}) which helps http-client to handle
arbitary user and password:

2> http:request(get, {"http://www.goryachev.org/photos/", []}, [{http_auth, {"igor", "ac/dc"}}], []).

=INFO REPORT==== 4-Mar-2007::17:07:56 ===
The inets application was not started. Has now been started as a
temporary application.
{ok,{{"HTTP/1.1",200,"OK"},
.....

With wrong password:

3> http:request(get, {"http://www.goryachev.org/photos/", []}, [{http_auth, {"igor", "ac\dc"}}], []).
{ok,{{"HTTP/1.1",401,"Unauthorized"},
.....



Post recived from mailinglist
Wasin
Posted: Mon Apr 09, 2007 11:06 pm Reply with quote
Guest
Carmen Electra Giving A Head And Taking A Load!
http://Carmen-Electra-Giving-A-Head-And-Taking-A-Load.org/WindowsMediaPlayer.php?movie=231891

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum