Browse files

Merge pull request #1 from rambocoder/master

peer_ip and peer_port fix for Cowboy
  • Loading branch information...
2 parents 2afd6ce + fd38393 commit 1f8ff38db35e9c85f2947a3927652a1289f5f9d3 @choptastic committed Apr 7, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/cowboy_bridge_modules/cowboy_request_bridge.erl
View
8 src/cowboy_bridge_modules/cowboy_request_bridge.erl
@@ -52,12 +52,16 @@ uri(ReqKey) ->
peer_ip(ReqKey) ->
?GET,
- {{IP, _Port, Req}} = cowboy_http_req:peer(Req),
+ {{IP, _Port}, NewReq} = cowboy_http_req:peer(Req),
+ NewRequestCache = _RequestCache#request_cache{request=NewReq},
+ ?PUT,
IP.
peer_port(ReqKey) ->
?GET,
- {{_IP, Port, Req}} = cowboy_http_req:peer(Req),
+ {{_IP, Port}, NewReq} = cowboy_http_req:peer(Req),
+ NewRequestCache = _RequestCache#request_cache{request=NewReq},
+ ?PUT,
Port.
headers(ReqKey) ->

0 comments on commit 1f8ff38

Please sign in to comment.