diff options
Diffstat (limited to 'src/cow_uri_template.erl')
-rw-r--r-- | src/cow_uri_template.erl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cow_uri_template.erl b/src/cow_uri_template.erl index eac784f..e3d1c65 100644 --- a/src/cow_uri_template.erl +++ b/src/cow_uri_template.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2019, Loïc Hoguin <[email protected]> +%% Copyright (c) Loïc Hoguin <[email protected]> %% %% Permission to use, copy, modify, and/or distribute this software for any %% purpose with or without fee is hereby granted, provided that the above @@ -310,6 +310,9 @@ urlencode_unreserved(<<C,R/bits>>, Acc) -> urlencode_unreserved(<<>>, Acc) -> Acc. +urlencode_reserved(<<$%,H,L,R/bits>>, Acc) + when ?IS_HEX(H), ?IS_HEX(L) -> + urlencode_reserved(R, <<Acc/binary,$%,H,L>>); urlencode_reserved(<<C,R/bits>>, Acc) when ?IS_URI_UNRESERVED(C) or ?IS_URI_GEN_DELIMS(C) or ?IS_URI_SUB_DELIMS(C) -> urlencode_reserved(R, <<Acc/binary,C>>); @@ -336,6 +339,7 @@ expand_uritemplate_test_() -> end ])), fun() -> + io:format("expected: ~0p", [Expected]), case Expected of false -> {'EXIT', _} = (catch expand(URITemplate, Vars)); |