Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Cowboy Bridge fix #15

Merged
merged 2 commits into from

2 participants

Namdak Tonpa Jesse Gumm
Namdak Tonpa
5HT commented

peer port wrong

Jesse Gumm choptastic merged commit a50988f into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 24, 2012
  1. Namdak Tonpa

    uri

    5HT authored
Commits on Nov 1, 2012
  1. Namdak Tonpa

    port

    5HT authored
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/cowboy_bridge_modules/cowboy_request_bridge.erl
7 src/cowboy_bridge_modules/cowboy_request_bridge.erl
View
@@ -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.
Something went wrong with that request. Please try again.