Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Cowboy Bridge fix #15

Merged
merged 2 commits into from

2 participants

@5HT
5HT commented

peer port wrong

@choptastic choptastic merged commit a50988f into nitrogen:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 24, 2012
  1. @5HT

    uri

    5HT authored
Commits on Nov 1, 2012
  1. @5HT

    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
View
7 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.
Something went wrong with that request. Please try again.