File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -15,10 +15,10 @@ def report(uri: String): Unit = {
15
15
}
16
16
def main() = {
17
17
println(urldecode("%2F%20%20!"))
18
+ println(urldecode(urlencodePermissive("Hallo Welt!/&^$@^*(&$)(*!_!_+\")")))
19
+ println(urlencodePermissive("Hallo Welt!/&^$@^*(&$)(*!_!_+\")"))
18
20
println(urldecode(urlencode("Hallo Welt!/&^$@^*(&$)(*!_!_+\")")))
19
21
println(urlencode("Hallo Welt!/&^$@^*(&$)(*!_!_+\")"))
20
- println(urldecode(urlencodeStrict("Hallo Welt!/&^$@^*(&$)(*!_!_+\")")))
21
- println(urlencodeStrict("Hallo Welt!/&^$@^*(&$)(*!_!_+\")"))
22
22
23
23
// examples from the spec
24
24
report("ftp://ftp.is.co.za/rfc/rfc1808.txt")
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ def isSubDelim(c: Char): Bool = c match {
53
53
}
54
54
55
55
/// Encodes the string for urls using %-escapes
56
- def urlencode (s: String): String = urlencode(s){
56
+ def urlencodePermissive (s: String): String = urlencode(s){
57
57
case '%' => true
58
58
case ' ' => true
59
59
case c and c.isGenDelim || c.isSubDelim => true
@@ -73,7 +73,7 @@ def isUnreserved(c: Char): Bool = c match {
73
73
/// Encodes the string for urls using %-escapes,
74
74
/// escaping everything that is not an unreserved character
75
75
/// as per RFC 3986.
76
- def urlencodeStrict (s: String): String =
76
+ def urlencode (s: String): String =
77
77
urlencode(s){ c => not(c.isUnreserved) }
78
78
79
79
You can’t perform that action at this time.
0 commit comments