urllib: put braces in << | expressions in urllib.v to make test pass

pull/4288/head
Delyan Angelov 2020-04-07 22:57:44 +03:00
parent cb52dd85e7
commit 582ee9e643
2 changed files with 2 additions and 3 deletions

View File

@ -38,7 +38,6 @@ const (
'vlib/net/http/http_test.v',
'vlib/net/socket_test.v',
'vlib/net/socket_udp_test.v',
'vlib/net/urllib/urllib_test.v',
'vlib/os/environment_test.v', // Linux only
'vlib/rand/pcg32_test.v',
'vlib/rand/splitmix64_test.v',

View File

@ -182,7 +182,7 @@ fn unescape(s_ string, mode EncodingMode) ?string {
// That is, you can use escaping in the zone identifier but not
// to introduce bytes you couldn't just write directly.
// But Windows puts spaces here! Yay.
v := (unhex(s[i + 1])<<byte(4) | unhex(s[i + 2]))
v := ( (unhex(s[i + 1])<<byte(4)) | unhex(s[i + 2]))
if s[i..i + 3] != '%25' && v != ` ` && should_escape(v, .encode_host) {
error(error_msg(err_msg_escape, s[i..i + 3]))
}
@ -208,7 +208,7 @@ fn unescape(s_ string, mode EncodingMode) ?string {
x := s[i]
match x {
`%` {
t.write((unhex(s[i + 1])<<byte(4) | unhex(s[i + 2])).str())
t.write( ((unhex(s[i + 1])<<byte(4)) | unhex(s[i + 2])).str() )
i += 2
}
`+` {