aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src
diff options
context:
space:
mode:
Diffstat (limited to 'lib/inets/src')
-rw-r--r--lib/inets/src/http_lib/http_uri.erl17
1 files changed, 2 insertions, 15 deletions
diff --git a/lib/inets/src/http_lib/http_uri.erl b/lib/inets/src/http_lib/http_uri.erl
index b470fd0b46..d03acff3a9 100644
--- a/lib/inets/src/http_lib/http_uri.erl
+++ b/lib/inets/src/http_lib/http_uri.erl
@@ -47,19 +47,7 @@ encode(URI) ->
lists:append(lists:map(fun(Char) -> uri_encode(Char, Reserved) end, URI)).
decode(String) ->
- try
- begin
- do_decode(String)
- end
- catch
- throw:{bad_hex_value, _BadChar} ->
- %% The string is either badly encoded or a string
- %% containing a % followed by a non-hex char.
- %% In any case, return as-is since there is nothing
- %% we can do...
- %% Note that the valid hex-chars are: 0-9, a-f and A-F.
- String
- end.
+ do_decode(String).
do_decode([$%,Hex1,Hex2|Rest]) ->
[hex2dec(Hex1)*16+hex2dec(Hex2)|do_decode(Rest)];
@@ -156,5 +144,4 @@ uri_encode(Char, Reserved) ->
hex2dec(X) when (X>=$0) andalso (X=<$9) -> X-$0;
hex2dec(X) when (X>=$A) andalso (X=<$F) -> X-$A+10;
-hex2dec(X) when (X>=$a) andalso (X=<$f) -> X-$a+10;
-hex2dec(X) -> throw({bad_hex_value, X}).
+hex2dec(X) when (X>=$a) andalso (X=<$f) -> X-$a+10.