aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_router.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-01-31 18:50:32 +0100
committerLoïc Hoguin <[email protected]>2017-01-31 18:50:32 +0100
commit844115826044db2be3bc23392c21ecffada10a24 (patch)
treea0f81965ddc3a7f013f8fa4b60db29155df7e1d7 /src/cowboy_router.erl
parent3b4de4384ae2d6ac9de82a6565d18bba2bf8a6ab (diff)
downloadcowboy-844115826044db2be3bc23392c21ecffada10a24.tar.gz
cowboy-844115826044db2be3bc23392c21ecffada10a24.tar.bz2
cowboy-844115826044db2be3bc23392c21ecffada10a24.zip
Fix wrong path url decoding algorithm
I embed cow_uri since I can't update Cowlib further easily. This is most likely a one shot release so it shouldn't be a problem to do things a little more dirty than usual.
Diffstat (limited to 'src/cowboy_router.erl')
-rw-r--r--src/cowboy_router.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cowboy_router.erl b/src/cowboy_router.erl
index ef91c6d..d2dc0d2 100644
--- a/src/cowboy_router.erl
+++ b/src/cowboy_router.erl
@@ -326,9 +326,9 @@ split_path(Path, Acc) ->
try
case binary:match(Path, <<"/">>) of
nomatch when Path =:= <<>> ->
- lists:reverse([cow_qs:urldecode(S) || S <- Acc]);
+ lists:reverse([cow_uri:urldecode(S) || S <- Acc]);
nomatch ->
- lists:reverse([cow_qs:urldecode(S) || S <- [Path|Acc]]);
+ lists:reverse([cow_uri:urldecode(S) || S <- [Path|Acc]]);
{Pos, _} ->
<< Segment:Pos/binary, _:8, Rest/bits >> = Path,
split_path(Rest, [Segment|Acc])