diff options
author | Péter Dimitrov <[email protected]> | 2017-10-23 12:02:16 +0200 |
---|---|---|
committer | Péter Dimitrov <[email protected]> | 2017-10-24 09:17:24 +0200 |
commit | da11b15aef87f392a807b4756bf285160e15a194 (patch) | |
tree | 56d5179ef9316f10268824ef1ab6044ec617564d /lib/stdlib/test | |
parent | b439d19d38479d6264d906dd926a168c9c514da3 (diff) | |
download | otp-da11b15aef87f392a807b4756bf285160e15a194.tar.gz otp-da11b15aef87f392a807b4756bf285160e15a194.tar.bz2 otp-da11b15aef87f392a807b4756bf285160e15a194.zip |
stdlib: Update supported separators (query string)
Update list of supported separators:
- escaped_amp (default): "&"
- amp: "&"
- semicolon: ";"
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r-- | lib/stdlib/test/uri_string_SUITE.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/stdlib/test/uri_string_SUITE.erl b/lib/stdlib/test/uri_string_SUITE.erl index b70cb842de..fe832ac82c 100644 --- a/lib/stdlib/test/uri_string_SUITE.erl +++ b/lib/stdlib/test/uri_string_SUITE.erl @@ -827,7 +827,8 @@ transcode_negative(_Config) -> compose_query(_Config) -> [] = uri_string:compose_query([]), "foo=1&bar=2" = uri_string:compose_query([{<<"foo">>,"1"}, {"bar", "2"}]), - "foo=1&bar=2" = uri_string:compose_query([{"foo","1"}, {"bar", "2"}],[{separator,amp}]), + "foo=1&bar=2" = uri_string:compose_query([{"foo","1"}, {"bar", "2"}],[{separator,escaped_amp}]), + "foo=1&bar=2" = uri_string:compose_query([{"foo","1"}, {"bar", "2"}],[{separator,amp}]), "foo=1;bar=2" = uri_string:compose_query([{"foo","1"}, {"bar", "2"}],[{separator,semicolon}]), "foo+bar=1&%C3%B6=2" = uri_string:compose_query([{"foo bar","1"}, {"ö", "2"}]). @@ -837,12 +838,13 @@ compose_query_negative(_Config) -> dissect_query(_Config) -> [] = uri_string:dissect_query(""), [{"foo","1"}, {"bar", "2"}] = uri_string:dissect_query("foo=1&bar=2"), + [{"foo","1"}, {"bar", "2"}] = uri_string:dissect_query("foo=1&bar=2"), [{"foo","1"}, {"bar", "2"}] = uri_string:dissect_query("foo=1;bar=2"), [{"foo","1"}, {"bar", "222"}] = uri_string:dissect_query([<<"foo=1;bar=2">>,"22"]), [{"foo","ö"}, {"bar", "2"}] = uri_string:dissect_query("foo=%C3%B6&bar=2"). dissect_query_negative(_Config) -> - {error,invalid_separator,"≈bar=2"} = + {error,urldecode,";bar"} = uri_string:dissect_query("foo=1≈bar=2"), {error,urldecode,"&bar"} = uri_string:dissect_query("foo1&bar=2"), |