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 +4 -4
- data/lib/rack.rb +1 -1
- data/lib/rack/mock.rb +7 -7
- data/lib/rack/session/abstract/id.rb +1 -1
- data/test/spec_mock.rb +17 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17cc155727caff77770fb98d752892acbb5c3a77
|
4
|
+
data.tar.gz: 60a9aec0727551bc33323e06b30e930027f2d5c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84cc54271f0d00b51ef4be8c1f3e35a90ada7d88918653ed35276db93c2cac66f004fa4c6c092ac92a0fced6da86ebc65b11e83a0aa6be6143bdcc82d938b27b
|
7
|
+
data.tar.gz: c6cabd254ed040468806288a9765002a5d029ab35239280cfd2877f773b543b6d32489945cc78e8a0b09f6b494790da2963b73d5d1f61be5c8a4f2b3563ed2c0
|
data/lib/rack.rb
CHANGED
data/lib/rack/mock.rb
CHANGED
@@ -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)
|
data/test/spec_mock.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2017-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|