Permalink
Browse files

Merge pull request #15 from 5HT/master

Cowboy Bridge fix for peer port and uri
  • Loading branch information...
2 parents ffc65a0 + 70c05e4 commit a50988f769b21e05b09a5ef77baf7a9a6502ce07 @choptastic choptastic committed Nov 1, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/cowboy_bridge_modules/cowboy_request_bridge.erl
@@ -47,7 +47,10 @@ path(ReqKey) ->
uri(ReqKey) ->
?GET,
- {RawPath, Req} = cowboy_http_req:raw_path(Req),
+ {RawPath, Req} = case cowboy_http_req:raw_path(Req) of
+ undefined -> {undefined, ok};
+ {P, R} -> {P, R}
+ end,
b2l(RawPath).
peer_ip(ReqKey) ->
@@ -59,7 +62,7 @@ peer_ip(ReqKey) ->
peer_port(ReqKey) ->
?GET,
- {{_IP, Port}, NewReq} = cowboy_http_req:peer(Req),
+ {Port, NewReq} = cowboy_http_req:port(Req),
NewRequestCache = _RequestCache#request_cache{request=NewReq},
?PUT,
Port.

0 comments on commit a50988f

Please sign in to comment.