rack 2.0.2 → 2.0.3

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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8fee84474048108cce439e6089d87176a6870bc2
4
- data.tar.gz: 0ed86a0e0e70541873ffa31dfef66e5268a107b2
3
+ metadata.gz: 17cc155727caff77770fb98d752892acbb5c3a77
4
+ data.tar.gz: 60a9aec0727551bc33323e06b30e930027f2d5c1
5
5
  SHA512:
6
- metadata.gz: 460ecadb871f77085e040982f9cb56fd2fd165f95d172c4ff73b3d16c899dc26f0e8a352667044dd32b34a57d3a179efe65f3b933c58adf7b0427566a6356188
7
- data.tar.gz: 1ab651dc52e8ff7ace49f22359aff5c7d2baff1787082398c7cf21aa593552183872466b3cf03e6675ca1621e44076e85cddae9486713311412e916baee5bac1
6
+ metadata.gz: 84cc54271f0d00b51ef4be8c1f3e35a90ada7d88918653ed35276db93c2cac66f004fa4c6c092ac92a0fced6da86ebc65b11e83a0aa6be6143bdcc82d938b27b
7
+ data.tar.gz: c6cabd254ed040468806288a9765002a5d029ab35239280cfd2877f773b543b6d32489945cc78e8a0b09f6b494790da2963b73d5d1f61be5c8a4f2b3563ed2c0
@@ -18,7 +18,7 @@ module Rack
18
18
  VERSION.join(".")
19
19
  end
20
20
 
21
- RELEASE = "2.0.2"
21
+ RELEASE = "2.0.3"
22
22
 
23
23
  # Return the Rack release as a dotted string.
24
24
  def self.release
@@ -91,13 +91,13 @@ module Rack
91
91
 
92
92
  env = DEFAULT_ENV.dup
93
93
 
94
- env[REQUEST_METHOD] = opts[:method] ? opts[:method].to_s.upcase : GET
95
- env[SERVER_NAME] = uri.host || "example.org"
96
- env[SERVER_PORT] = uri.port ? uri.port.to_s : "80"
97
- env[QUERY_STRING] = uri.query.to_s
98
- env[PATH_INFO] = (!uri.path || uri.path.empty?) ? "/" : uri.path
99
- env[RACK_URL_SCHEME] = uri.scheme || "http"
100
- env[HTTPS] = env[RACK_URL_SCHEME] == "https" ? "on" : "off"
94
+ env[REQUEST_METHOD] = (opts[:method] ? opts[:method].to_s.upcase : GET).b
95
+ env[SERVER_NAME] = (uri.host || "example.org").b
96
+ env[SERVER_PORT] = (uri.port ? uri.port.to_s : "80").b
97
+ env[QUERY_STRING] = (uri.query.to_s).b
98
+ env[PATH_INFO] = ((!uri.path || uri.path.empty?) ? "/" : uri.path).b
99
+ env[RACK_URL_SCHEME] = (uri.scheme || "http").b
100
+ env[HTTPS] = (env[RACK_URL_SCHEME] == "https" ? "on" : "off").b
101
101
 
102
102
  env[SCRIPT_NAME] = opts[:script_name] || ""
103
103
 
@@ -408,7 +408,7 @@ module Rack
408
408
 
409
409
  class ID < Persisted
410
410
  def self.inherited(klass)
411
- k = klass.ancestors.find { |kl| kl.superclass == ID }
411
+ k = klass.ancestors.find { |kl| kl.respond_to?(:superclass) && kl.superclass == ID }
412
412
  unless k.instance_variable_defined?(:"@_rack_warned")
413
413
  warn "#{klass} is inheriting from #{ID}. Inheriting from #{ID} is deprecated, please inherit from #{Persisted} instead" if $VERBOSE
414
414
  k.instance_variable_set(:"@_rack_warned", true)
@@ -211,6 +211,23 @@ describe Rack::MockRequest do
211
211
  Rack::MockRequest.new(capp).get('/', :lint => true)
212
212
  called.must_equal true
213
213
  end
214
+
215
+ it "defaults encoding to ASCII 8BIT" do
216
+ req = Rack::MockRequest.env_for("/foo")
217
+
218
+ keys = [
219
+ Rack::REQUEST_METHOD,
220
+ Rack::SERVER_NAME,
221
+ Rack::SERVER_PORT,
222
+ Rack::QUERY_STRING,
223
+ Rack::PATH_INFO,
224
+ Rack::HTTPS,
225
+ Rack::RACK_URL_SCHEME
226
+ ]
227
+ keys.each do |k|
228
+ assert_equal Encoding::ASCII_8BIT, req[k].encoding
229
+ end
230
+ end
214
231
  end
215
232
 
216
233
  describe Rack::MockResponse do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Neukirchen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-08 00:00:00.000000000 Z
11
+ date: 2017-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest