rack 1.5.0 → 1.5.1
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 +5 -0
- data/Rakefile +3 -1
- data/SPEC +1 -1
- data/lib/rack/lint.rb +6 -1
- data/lib/rack/session/abstract/id.rb +14 -2
- data/rack.gemspec +1 -1
- data/test/spec_lint.rb +7 -0
- data/test/spec_request.rb +5 -0
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -506,6 +506,11 @@ run on port 11211) and memcache-client installed.
|
|
506
506
|
* Updated HTTP status codes
|
507
507
|
* Ruby 1.8.6 likely no longer passes tests, and is no longer fully supported
|
508
508
|
|
509
|
+
* January 28th, 2013: Thirty fourth public release 1.5.1
|
510
|
+
* Rack::Lint check_hijack now conforms to other parts of SPEC
|
511
|
+
* Added hash-like methods to Abstract::ID::SessionHash for compatibility
|
512
|
+
* Various documentation corrections
|
513
|
+
|
509
514
|
== Contact
|
510
515
|
|
511
516
|
Please post bugs, suggestions and patches to
|
data/Rakefile
CHANGED
@@ -52,7 +52,9 @@ task :changelog => %w[ChangeLog]
|
|
52
52
|
file '.git/index'
|
53
53
|
file "ChangeLog" => '.git/index' do
|
54
54
|
File.open("ChangeLog", "w") { |out|
|
55
|
-
`git log -z
|
55
|
+
log = `git log -z`
|
56
|
+
log.force_encoding(Encoding::BINARY) if log.respond_to?(:force_encoding)
|
57
|
+
log.split("\0").map { |chunk|
|
56
58
|
author = chunk[/Author: (.*)/, 1].strip
|
57
59
|
date = chunk[/Date: (.*)/, 1].strip
|
58
60
|
desc, detail = $'.strip.split("\n", 2)
|
data/SPEC
CHANGED
@@ -53,7 +53,7 @@ below.
|
|
53
53
|
RFC3875 section 4.1.18</a> for specific behavior.
|
54
54
|
In addition to this, the Rack environment must include these
|
55
55
|
Rack-specific variables:
|
56
|
-
<tt>rack.version</tt>:: The Array
|
56
|
+
<tt>rack.version</tt>:: The Array representing this version of Rack. See Rack::VERSION, that corresponds to the version of this SPEC.
|
57
57
|
<tt>rack.url_scheme</tt>:: +http+ or +https+, depending on the request URL.
|
58
58
|
<tt>rack.input</tt>:: See below, the input stream.
|
59
59
|
<tt>rack.errors</tt>:: See below, the error stream.
|
data/lib/rack/lint.rb
CHANGED
@@ -118,7 +118,7 @@ module Rack
|
|
118
118
|
## In addition to this, the Rack environment must include these
|
119
119
|
## Rack-specific variables:
|
120
120
|
|
121
|
-
## <tt>rack.version</tt>:: The Array
|
121
|
+
## <tt>rack.version</tt>:: The Array representing this version of Rack. See Rack::VERSION, that corresponds to the version of this SPEC.
|
122
122
|
## <tt>rack.url_scheme</tt>:: +http+ or +https+, depending on the request URL.
|
123
123
|
## <tt>rack.input</tt>:: See below, the input stream.
|
124
124
|
## <tt>rack.errors</tt>:: See below, the error stream.
|
@@ -500,6 +500,11 @@ module Rack
|
|
500
500
|
## It is also possible to hijack a response after the status and headers
|
501
501
|
## have been sent.
|
502
502
|
def check_hijack_response(headers, env)
|
503
|
+
|
504
|
+
# this check uses headers like a hash, but the spec only requires
|
505
|
+
# headers respond to #each
|
506
|
+
headers = Rack::Utils::HeaderHash.new(headers)
|
507
|
+
|
503
508
|
## In order to do this, an application may set the special header
|
504
509
|
## <tt>rack.hijack</tt> to an object that responds to <tt>call</tt>
|
505
510
|
## accepting an argument that conforms to the <tt>rack.hijack_io</tt>
|
@@ -24,6 +24,10 @@ module Rack
|
|
24
24
|
include Enumerable
|
25
25
|
attr_writer :id
|
26
26
|
|
27
|
+
def self.set_options(env, options)
|
28
|
+
env[ENV_SESSION_OPTIONS_KEY] = options.dup
|
29
|
+
end
|
30
|
+
|
27
31
|
def initialize(store, env)
|
28
32
|
@store = store
|
29
33
|
@env = env
|
@@ -117,6 +121,14 @@ module Rack
|
|
117
121
|
@data.empty?
|
118
122
|
end
|
119
123
|
|
124
|
+
def keys
|
125
|
+
@data.keys
|
126
|
+
end
|
127
|
+
|
128
|
+
def values
|
129
|
+
@data.values
|
130
|
+
end
|
131
|
+
|
120
132
|
private
|
121
133
|
|
122
134
|
def load_for_read!
|
@@ -359,8 +371,8 @@ module Rack
|
|
359
371
|
end
|
360
372
|
|
361
373
|
# All thread safety and session storage proceedures should occur here.
|
362
|
-
#
|
363
|
-
#
|
374
|
+
# Must return the session id if the session was saved successfully, or
|
375
|
+
# false if the session could not be saved.
|
364
376
|
|
365
377
|
def set_session(env, sid, session, options)
|
366
378
|
raise '#set_session not implemented.'
|
data/rack.gemspec
CHANGED
data/test/spec_lint.rb
CHANGED
@@ -231,6 +231,13 @@ describe Rack::Lint do
|
|
231
231
|
[200, {"Foo-Bar" => "one\ntwo\nthree", "Content-Length" => "0", "Content-Type" => "text/plain" }, []]
|
232
232
|
}).call(env({}))
|
233
233
|
}.should.not.raise(Rack::Lint::LintError)
|
234
|
+
|
235
|
+
# non-Hash header responses should be allowed
|
236
|
+
lambda {
|
237
|
+
Rack::Lint.new(lambda { |env|
|
238
|
+
[200, [%w(Content-Type text/plain), %w(Content-Length 0)], []]
|
239
|
+
}).call(env({}))
|
240
|
+
}.should.not.raise(TypeError)
|
234
241
|
end
|
235
242
|
|
236
243
|
should "notice content-type errors" do
|
data/test/spec_request.rb
CHANGED
@@ -932,6 +932,11 @@ EOF
|
|
932
932
|
'HTTP_X_FORWARDED_FOR' => '3.4.5.6'
|
933
933
|
res.body.should.equal '1.2.3.4'
|
934
934
|
|
935
|
+
res = mock.get '/',
|
936
|
+
'REMOTE_ADDR' => '1.2.3.4',
|
937
|
+
'HTTP_X_FORWARDED_FOR' => 'unknown'
|
938
|
+
res.body.should.equal '1.2.3.4'
|
939
|
+
|
935
940
|
res = mock.get '/',
|
936
941
|
'REMOTE_ADDR' => '127.0.0.1',
|
937
942
|
'HTTP_X_FORWARDED_FOR' => '3.4.5.6'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bacon
|