mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 14:35:52 +01:00
Fix url encoding to encode whitespace to %20
This commit is contained in:
@@ -4,11 +4,21 @@ import org.specs2.mutable._
|
||||
|
||||
class StringUtilSpec extends Specification {
|
||||
|
||||
"urlEncode" should {
|
||||
"encode whitespace to %20" in {
|
||||
val encoded = StringUtil.urlEncode("aa bb")
|
||||
encoded mustEqual "aa%20bb"
|
||||
}
|
||||
}
|
||||
|
||||
"urlDecode" should {
|
||||
"decode encoded string to original string" in {
|
||||
val encoded = StringUtil.urlEncode("あいうえお")
|
||||
StringUtil.urlDecode(encoded) mustEqual "あいうえお"
|
||||
}
|
||||
"decode en%20 to whitespace" in {
|
||||
StringUtil.urlDecode("aa%20bb") mustEqual "aa bb"
|
||||
}
|
||||
}
|
||||
|
||||
"splitWords" should {
|
||||
|
||||
Reference in New Issue
Block a user