@@ -51,7 +51,7 @@ fn should_escape(c u8, mode EncodingMode) bool {
5151 // we could possibly allow, and parse will reject them if we
5252 // escape them (because hosts can`t use %-encoding for
5353 // ASCII bytes).
54- if c in [`!` , `$` , `&` , `\\ ` , `(` , `)` , `*` , `+` , `,` , `;` , `=` , `:` , `[` , `]` , `<` , `>` ,
54+ if c in [`!` , `$` , `&` , `' ` , `(` , `)` , `*` , `+` , `,` , `;` , `=` , `:` , `[` , `]` , `<` , `>` ,
5555 `"` ] {
5656 return false
5757 }
@@ -203,7 +203,7 @@ fn unescape(s_ string, mode EncodingMode) !string {
203203 else {
204204 if (mode == .encode_host || mode == .encode_zone) && s[i] < 0x80
205205 && should_escape (s[i], mode) {
206- error (error_msg ('unescape: invalid character in host name' , s[i..i + 1 ]))
206+ return error (error_msg ('unescape: invalid character in host name' , s[i..i + 1 ]))
207207 }
208208 i++
209209 }
@@ -1025,7 +1025,7 @@ pub fn valid_userinfo(s string) bool {
10251025 continue
10261026 }
10271027 match r {
1028- `-` , `.` , `_` , `:` , `~` , `!` , `$` , `&` , `\\ ` , `(` , `)` , `*` , `+` , `,` , `;` , `=` , `%` ,
1028+ `-` , `.` , `_` , `:` , `~` , `!` , `$` , `&` , `' ` , `(` , `)` , `*` , `+` , `,` , `;` , `=` , `%` ,
10291029 `@` {
10301030 continue
10311031 }
0 commit comments