rack 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rack might be problematic. Click here for more details.
- data/README.rdoc +3 -0
- data/lib/rack/backports/uri/common.rb +3 -3
- data/lib/rack/utils.rb +1 -1
- data/rack.gemspec +1 -1
- data/test/spec_utils.rb +8 -0
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -352,6 +352,9 @@ run on port 11211) and memcache-client installed.
|
|
352
352
|
* Rack::MockResponse calls close on the body object
|
353
353
|
* Fix a DOS vector from MRI stdlib backport
|
354
354
|
|
355
|
+
* July 16, 2011: Sixteenth public release 1.3.2
|
356
|
+
* Fix for Rails and rack-test, Rack::Utils#escape calls to_s
|
357
|
+
|
355
358
|
== Contact
|
356
359
|
|
357
360
|
Please post bugs, suggestions and patches to
|
@@ -10,7 +10,7 @@ module URI
|
|
10
10
|
TBLENCWWWCOMP_ = {} # :nodoc:
|
11
11
|
TBLDECWWWCOMP_ = {} # :nodoc:
|
12
12
|
|
13
|
-
# Encode given +
|
13
|
+
# Encode given +s+ to URL-encoded form data.
|
14
14
|
#
|
15
15
|
# This method doesn't convert *, -, ., 0-9, A-Z, _, a-z, but does convert SP
|
16
16
|
# (ASCII space) to + and converts others to %XX.
|
@@ -19,7 +19,8 @@ module URI
|
|
19
19
|
# http://www.w3.org/TR/html5/forms.html#url-encoded-form-data
|
20
20
|
#
|
21
21
|
# See URI.decode_www_form_component, URI.encode_www_form
|
22
|
-
def self.encode_www_form_component(
|
22
|
+
def self.encode_www_form_component(s)
|
23
|
+
str = s.to_s
|
23
24
|
if RUBY_VERSION < "1.9" && $KCODE =~ /u/i
|
24
25
|
str.gsub(/([^ a-zA-Z0-9_.-]+)/) do
|
25
26
|
'%' + $1.unpack('H2' * Rack::Utils.bytesize($1)).join('%').upcase
|
@@ -37,7 +38,6 @@ module URI
|
|
37
38
|
rescue
|
38
39
|
end
|
39
40
|
end
|
40
|
-
str = str.to_s
|
41
41
|
str.gsub(/[^*\-.0-9A-Z_a-z]/) {|m| TBLENCWWWCOMP_[m]}
|
42
42
|
end
|
43
43
|
end
|
data/lib/rack/utils.rb
CHANGED
data/rack.gemspec
CHANGED
data/test/spec_utils.rb
CHANGED
@@ -41,6 +41,14 @@ describe Rack::Utils do
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
+
should "escape objects that responds to to_s" do
|
45
|
+
default_kcode, $KCODE = $KCODE, 'U'
|
46
|
+
|
47
|
+
Rack::Utils.escape(:id).should.equal "id"
|
48
|
+
|
49
|
+
$KCODE = default_kcode
|
50
|
+
end
|
51
|
+
|
44
52
|
if "".respond_to?(:encode)
|
45
53
|
should "escape non-UTF8 strings" do
|
46
54
|
Rack::Utils.escape("ø".encode("ISO-8859-1")).should.equal "%F8"
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 1.3.
|
9
|
+
- 2
|
10
|
+
version: 1.3.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Christian Neukirchen
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-07-
|
18
|
+
date: 2011-07-26 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: bacon
|