Skip to content

Commit

Permalink
Merge pull request #15 from 5HT/master
Browse files Browse the repository at this point in the history
Cowboy Bridge fix for peer port and uri
  • Loading branch information
choptastic committed Nov 1, 2012
2 parents ffc65a0 + 70c05e4 commit a50988f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/cowboy_bridge_modules/cowboy_request_bridge.erl
Expand Up @@ -47,7 +47,10 @@ path(ReqKey) ->


uri(ReqKey) -> uri(ReqKey) ->
?GET, ?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). b2l(RawPath).


peer_ip(ReqKey) -> peer_ip(ReqKey) ->
Expand All @@ -59,7 +62,7 @@ peer_ip(ReqKey) ->


peer_port(ReqKey) -> peer_port(ReqKey) ->
?GET, ?GET,
{{_IP, Port}, NewReq} = cowboy_http_req:peer(Req), {Port, NewReq} = cowboy_http_req:port(Req),
NewRequestCache = _RequestCache#request_cache{request=NewReq}, NewRequestCache = _RequestCache#request_cache{request=NewReq},
?PUT, ?PUT,
Port. Port.
Expand Down

0 comments on commit a50988f

Please sign in to comment.