https requests with parameters failing using 13b04 httpc module

Jebu Ittiachen <>
Wed Apr 28 13:01:28 CEST 2010


  After moving to R13B04 oauth requests to fireeagle for the service I run
at has been failing with an error "Invalid OAuth
signature" from the server side. The same code has been working fine on

  Digging thru it looks like httpc is sending the host header as host:port
for ports other than 80. Here is the debug logs

[inets httpc trace 60 <0.170.0> 2010:04:28 09:46:58 4773] send
   Content: [{module,httpc_request},
             {message,["GET"," ",

                       " ","HTTP/1.1","\r\n",
                       "te: \r\nhost:\r\nconnection:

  Following patch fixes the issue atleast for this case, but not sure if the
spec says the host header should have the port or not

--- /tmp/httpc.erl 2010-04-28 16:26:39.000000000 +0530
+++ lib/inets/src/http_client/httpc.erl 2010-04-28 16:27:12.000000000 +0530
@@ -895,6 +895,8 @@
     throw({error, {bad_option, Option, BadValue}}).

+header_host(Host, 443 = _Port) ->
+    Host;
 header_host(Host, 80 = _Port) ->
 header_host(Host, Port) ->

Jebu Ittiachen

More information about the erlang-bugs mailing list