Skip to content

Commit 758e934

Browse files
author
Patrick Sachs
committed
fixed: URL is missing the query string
1 parent bc9517e commit 758e934

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/cowboy_reverse_proxy.erl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@ request(Req, Opts) ->
126126
request_url(Req, Opts) ->
127127
Path = cowboy_req:path(Req),
128128
ModifyFun = opts_modify_path(Opts),
129-
NewPath = ModifyFun(to_string(Path)),
129+
OrigPath = case cowboy_req:qs(Req) of
130+
<<>> -> Path;
131+
Qs -> [Path, $?, Qs]
132+
end,
133+
NewPath = ModifyFun(to_string(OrigPath)),
130134
to_string([opts_protocol(Opts), "://", opts_host(Opts), NewPath]).
131135

132136
%% Creates the request headers.

0 commit comments

Comments
 (0)