<HTML>
<HEAD>
<TITLE>Proposed patch to httpc_response.erl (R13A)</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi,<BR>
<BR>
I am new to Erlang, so please bear with me:<BR>
<BR>
Fix_relative_uri function was giving me errors, because Port variable is not a list, but an integer, and ++ operator bombed.<BR>
<BR>
Proposed patch (tested on several web pages with relative URI on the Location response, found working fine):<BR>
<BR>
mtalyans@dev-db4$ diff -Naur httpc_response.erl.orig httpc_response.erl<BR>
--- httpc_response.erl.orig 2009-04-08 09:02:44.000000000 -0700<BR>
+++ httpc_response.erl 2009-04-08 09:03:12.000000000 -0700<BR>
@@ -364,13 +364,18 @@<BR>
end<BR>
end.<BR>
<BR>
+list_port(Port) when is_list(Port) -><BR>
+ Port;<BR>
+list_port(Port) when is_integer(Port) -><BR>
+ integer_to_list(Port).<BR>
+<BR>
%%% Guessing that we received a relative URI, fix it to become an absoluteURI<BR>
fix_relative_uri(Request, RedirUrl) -><BR>
{Server, Port} = Request#request.address,<BR>
Path = Request#request.path,<BR>
- atom_to_list(Request#request.scheme) ++ "://" ++ Server ++ ":" ++ Port<BR>
- ++ Path ++ RedirUrl.<BR>
- <BR>
+ atom_to_list(Request#request.scheme) ++ "://" ++ Server ++ ":" ++ list_port(Port)<BR>
+ ++ Path ++ RedirUrl.<BR>
+<BR>
error(#request{id = Id}, Reason) -><BR>
{Id, {error, Reason}}.<BR>
<BR>
Thanks!</SPAN></FONT>
</BODY>
</HTML>