bypass 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bypass/uri.rb +2 -2
- data/lib/bypass/version.rb +1 -1
- data/test/bypass/uri_test.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 714bf5827bed4b9dc48e2e8b02331d3ea037dbcb
|
4
|
+
data.tar.gz: 8308c92ac4c09c9f43ec0829014b372b45912f22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 961a97ba6833870c7dbee87389ec2b98795b402baa2c879726f8c0b5d26e585a1234252fb8b6b6cd3da4142cd5e5c494685cb28579ca948f2594d8fc08595532
|
7
|
+
data.tar.gz: 9a915ca624bb6bb3913834f322d3ba2985eff78a74abaa92f70f622d155afed1ac804e30e06bdd842268640143efc01b99a62b7b282e50762fd339b216aef099
|
data/lib/bypass/uri.rb
CHANGED
@@ -4,8 +4,8 @@ module Bypass
|
|
4
4
|
class URI < Addressable::URI
|
5
5
|
def append_to_query_values(params = {})
|
6
6
|
pairs = params.keys.map do |raw_key|
|
7
|
-
key =
|
8
|
-
val =
|
7
|
+
key = CGI.escape(raw_key.to_s)
|
8
|
+
val = CGI.escape(params[raw_key])
|
9
9
|
[key, val].join("=")
|
10
10
|
end
|
11
11
|
|
data/lib/bypass/version.rb
CHANGED
data/test/bypass/uri_test.rb
CHANGED
@@ -35,13 +35,13 @@ class Bypass::URITest < MiniTest::Test
|
|
35
35
|
should "encode keys" do
|
36
36
|
uri = Bypass::URI.parse("http://www.getdrip.com")
|
37
37
|
uri.append_to_query_values("first name" => "Ian")
|
38
|
-
assert_equal "http://www.getdrip.com?first
|
38
|
+
assert_equal "http://www.getdrip.com?first+name=Ian", uri.to_s
|
39
39
|
end
|
40
40
|
|
41
41
|
should "encode values" do
|
42
42
|
uri = Bypass::URI.parse("http://www.getdrip.com")
|
43
43
|
uri.append_to_query_values(:name => "Ian Nance")
|
44
|
-
assert_equal "http://www.getdrip.com?name=Ian
|
44
|
+
assert_equal "http://www.getdrip.com?name=Ian+Nance", uri.to_s
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|