urllib: fix string length in escape()

pull/2904/head
sh0f 2019-11-27 17:15:05 +08:00 committed by Alexander Medvednikov
parent 584786d87c
commit dbaa37ea46
1 changed files with 2 additions and 2 deletions

View File

@ -277,7 +277,7 @@ fn escape(s string, mode EncodingMode) string {
t[i] = `+`
}
}
return string(t)
return string(t, t.len)
}
upperhex := '0123456789ABCDEF'
@ -297,7 +297,7 @@ fn escape(s string, mode EncodingMode) string {
j++
}
}
return string(t)
return string(t, t.len)
}
// A URL represents a parsed URL (technically, a URI reference).