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.

@@ -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 +str+ to URL-encoded form data.
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(str)
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
@@ -18,7 +18,7 @@ module Rack
18
18
  # applications adopted from all kinds of Ruby libraries.
19
19
 
20
20
  module Utils
21
- # URI escapes a string. (CGI style space to +)
21
+ # URI escapes. (CGI style space to +)
22
22
  def escape(s)
23
23
  URI.encode_www_form_component(s)
24
24
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "rack"
3
- s.version = "1.3.1"
3
+ s.version = "1.3.2"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.summary = "a modular Ruby webserver interface"
6
6
 
@@ -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: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
- - 1
10
- version: 1.3.1
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-13 00:00:00 Z
18
+ date: 2011-07-26 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: bacon