File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,7 @@ defmodule URI do
137137 def decode ( << >> ) , do: << >>
138138
139139 defp hex2dec ( n ) when n in ?A .. ?F , do: n - ?A + 10
140+ defp hex2dec ( n ) when n in ?a .. ?f , do: n - ?a + 10
140141 defp hex2dec ( n ) when n in ?0 .. ?9 , do: n - ?0
141142
142143 defp check_plus ( ?+ ) , do: 32
Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ defmodule URITest do
155155 port_uri = URI . parse ( "http://[#{ addr } ]:2222/" )
156156 assert port_uri . host == addr
157157 assert port_uri . port == 2222
158-
158+
159159 userinfo_port_uri = URI . parse ( "http://user:pass@[#{ addr } ]:2222/" )
160160 assert userinfo_port_uri . host == addr
161161 assert userinfo_port_uri . userinfo == "user:pass"
@@ -176,4 +176,9 @@ defmodule URITest do
176176 assert to_string ( URI . parse ( "http://google.com?q=lol" ) ) == "http://google.com?q=lol"
177177 assert to_string ( URI . parse ( "http://google.com?q=lol#omg" ) ) == "http://google.com?q=lol#omg"
178178 end
179+
180+ test :escape do
181+ assert URI . decode ( "%2f%41%4a%55" ) == "/AJU"
182+ assert URI . decode ( "%2F%41%4A%55" ) == "/AJU"
183+ end
179184end
You can’t perform that action at this time.
0 commit comments