aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_lib/http_uri.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2011-11-15 12:09:50 +0100
committerMicael Karlberg <[email protected]>2011-11-15 12:09:50 +0100
commit451f76fca7a777ea1ffeb4da84bbb397a9743174 (patch)
tree36ef1d36b3b7894b4342159ea7333780b71e0c91 /lib/inets/src/http_lib/http_uri.erl
parentff305c1a15e34f1c8d4f923a8f0e532b4e946512 (diff)
parentb5a96738a6fb010f08d9cf5abdc1b2c3a50f0b6b (diff)
downloadotp-451f76fca7a777ea1ffeb4da84bbb397a9743174.tar.gz
otp-451f76fca7a777ea1ffeb4da84bbb397a9743174.tar.bz2
otp-451f76fca7a777ea1ffeb4da84bbb397a9743174.zip
Merge branch 'maint-r14'
Conflicts: lib/inets/doc/src/notes.xml lib/inets/src/http_lib/http_uri.erl lib/inets/src/inets_app/inets.appup.src lib/inets/vsn.mk
Diffstat (limited to 'lib/inets/src/http_lib/http_uri.erl')
-rw-r--r--lib/inets/src/http_lib/http_uri.erl22
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/inets/src/http_lib/http_uri.erl b/lib/inets/src/http_lib/http_uri.erl
index 74ffa37ca4..32c6305a79 100644
--- a/lib/inets/src/http_lib/http_uri.erl
+++ b/lib/inets/src/http_lib/http_uri.erl
@@ -49,20 +49,24 @@ encode(URI) ->
Reserved = sets:from_list([$;, $:, $@, $&, $=, $+, $,, $/, $?,
$#, $[, $], $<, $>, $\", ${, $}, $|,
$\\, $', $^, $%, $ ]),
- lists:append(lists:map(fun(Char) ->
- uri_encode(Char, Reserved)
- end, URI)).
-
-decode([$%,Hex1,Hex2|Rest]) ->
- [hex2dec(Hex1)*16+hex2dec(Hex2)|decode(Rest)];
-decode([First|Rest]) ->
- [First|decode(Rest)];
-decode([]) ->
+ %% lists:append(lists:map(fun(Char) -> uri_encode(Char, Reserved) end, URI)).
+ lists:append([uri_encode(Char, Reserved) || Char <- URI]).
+
+decode(String) ->
+ do_decode(String).
+
+do_decode([$%,Hex1,Hex2|Rest]) ->
+ [hex2dec(Hex1)*16+hex2dec(Hex2)|do_decode(Rest)];
+do_decode([First|Rest]) ->
+ [First|do_decode(Rest)];
+do_decode([]) ->
[].
+
%%%========================================================================
%%% Internal functions
%%%========================================================================
+
parse_scheme(AbsURI) ->
case split_uri(AbsURI, ":", {error, no_scheme}, 1, 1) of
{error, no_scheme} ->