Permalink
Browse files

peer_ip and peer_port need to be cached and Cowboy returns a differen…

…t tuple format.
  • Loading branch information...
1 parent 2afd6ce commit fd3839388079eca9c80d83fc7c1f8e97b17b8ec7 @rambocoder rambocoder committed Apr 7, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 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 fd38393

Please sign in to comment.