rack 1.6.6 → 1.6.7

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: 06de71024a96e8adb2d56a5a71d19c27108d9092
4
- data.tar.gz: f88faaa3f6981a646989fd5c6e7284ae7ef9fdc7
3
+ metadata.gz: 065b2269ac4d6c8df5afe4c6fe2867453135cf56
4
+ data.tar.gz: de8403605f28f65e5cfe788e2ca3b075cc1a2729
5
5
  SHA512:
6
- metadata.gz: 87a659e1fa075bcbd285f8aa484dac13d60835c69b0346429d7973095446478dcc409965caf6c35e5e46f73df3db97b0faf261d75785ca9f6b0605baf73088bd
7
- data.tar.gz: 9f956b12721c8f3858adb604fabe11e9bf823bfb750ff0da1d313ee597e461d2a022dc560a39a13ba279afbb0c6d6d763f15aba3fbf41e77a1b5c344e3b6b4d3
6
+ metadata.gz: 40dcd3ec3c36f816fd19e8dfcaf2dba2a25a0632e220617c41093ebdf8aeaeefb2b15901d5970487b71a37ffd88898369ac4d6bf9ee3bc897cd990d8fea3471d
7
+ data.tar.gz: 49595d3d9464fcbc8307478e25e772dd08abed0fd17c073e26abe1630d00eb3231cc55a250b1ad52f41ded2a62b2845ccd326cc9855a38420541fcfb5b7ad1d4
@@ -20,7 +20,7 @@ module Rack
20
20
 
21
21
  # Return the Rack release as a dotted string.
22
22
  def self.release
23
- "1.6.6"
23
+ "1.6.7"
24
24
  end
25
25
  PATH_INFO = 'PATH_INFO'.freeze
26
26
  REQUEST_METHOD = 'REQUEST_METHOD'.freeze
@@ -91,13 +91,7 @@ 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_with_encoding(env, opts, uri)
101
95
 
102
96
  env[SCRIPT_NAME] = opts[:script_name] || ""
103
97
 
@@ -148,6 +142,28 @@ module Rack
148
142
 
149
143
  env
150
144
  end
145
+
146
+ if "<3".respond_to? :encoding
147
+ def self.env_with_encoding(env, opts, uri)
148
+ env[REQUEST_METHOD] = (opts[:method] ? opts[:method].to_s.upcase : "GET").b
149
+ env["SERVER_NAME"] = (uri.host || "example.org").b
150
+ env["SERVER_PORT"] = (uri.port ? uri.port.to_s : "80").b
151
+ env[QUERY_STRING] = (uri.query.to_s).b
152
+ env[PATH_INFO] = ((!uri.path || uri.path.empty?) ? "/" : uri.path).b
153
+ env["rack.url_scheme"] = (uri.scheme || "http").b
154
+ env["HTTPS"] = (env["rack.url_scheme"] == "https" ? "on" : "off").b
155
+ end
156
+ else
157
+ def self.env_with_encoding(env, opts, uri)
158
+ env[REQUEST_METHOD] = opts[:method] ? opts[:method].to_s.upcase : "GET"
159
+ env["SERVER_NAME"] = uri.host || "example.org"
160
+ env["SERVER_PORT"] = uri.port ? uri.port.to_s : "80"
161
+ env[QUERY_STRING] = uri.query.to_s
162
+ env[PATH_INFO] = (!uri.path || uri.path.empty?) ? "/" : uri.path
163
+ env["rack.url_scheme"] = uri.scheme || "http"
164
+ env["HTTPS"] = env["rack.url_scheme"] == "https" ? "on" : "off"
165
+ end
166
+ end
151
167
  end
152
168
 
153
169
  # Rack::MockResponse provides useful helpers for testing your apps.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "rack"
3
- s.version = "1.6.6"
3
+ s.version = "1.6.7"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.summary = "a modular Ruby webserver interface"
6
6
  s.license = "MIT"
@@ -211,6 +211,26 @@ describe Rack::MockRequest do
211
211
  Rack::MockRequest.new(capp).get('/', :lint => true)
212
212
  called.should.equal true
213
213
  end
214
+
215
+ unless "<3".respond_to? :encoding
216
+ should "defaults encoding to ASCII 8BIT" do
217
+ req = Rack::MockRequest.env_for("/foo")
218
+
219
+ keys = [
220
+ Rack::REQUEST_METHOD,
221
+ "SERVER_NAME",
222
+ "SERVER_PORT",
223
+ Rack::QUERY_STRING,
224
+ Rack::PATH_INFO,
225
+ "rack.url_scheme",
226
+ "HTTPS"
227
+ ]
228
+
229
+ keys.each do |k|
230
+ req[k].encoding.should.equal Encoding::ASCII_8BIT
231
+ end
232
+ end
233
+ end
214
234
  end
215
235
 
216
236
  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: 1.6.6
4
+ version: 1.6.7
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: bacon