rack 1.6.12 → 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.

Files changed (142) hide show
  1. checksums.yaml +5 -5
  2. data/COPYING +1 -1
  3. data/HISTORY.md +138 -8
  4. data/README.rdoc +17 -25
  5. data/Rakefile +6 -14
  6. data/SPEC +10 -11
  7. data/contrib/rack_logo.svg +164 -111
  8. data/example/protectedlobster.rb +1 -1
  9. data/example/protectedlobster.ru +1 -1
  10. data/lib/rack.rb +70 -21
  11. data/lib/rack/auth/abstract/request.rb +5 -1
  12. data/lib/rack/auth/digest/params.rb +2 -3
  13. data/lib/rack/auth/digest/request.rb +1 -1
  14. data/lib/rack/body_proxy.rb +14 -9
  15. data/lib/rack/builder.rb +3 -3
  16. data/lib/rack/chunked.rb +5 -5
  17. data/lib/rack/{commonlogger.rb → common_logger.rb} +3 -3
  18. data/lib/rack/{conditionalget.rb → conditional_get.rb} +0 -0
  19. data/lib/rack/content_length.rb +2 -2
  20. data/lib/rack/deflater.rb +4 -39
  21. data/lib/rack/directory.rb +66 -54
  22. data/lib/rack/etag.rb +4 -3
  23. data/lib/rack/events.rb +154 -0
  24. data/lib/rack/file.rb +64 -40
  25. data/lib/rack/handler.rb +3 -25
  26. data/lib/rack/handler/cgi.rb +15 -16
  27. data/lib/rack/handler/fastcgi.rb +13 -14
  28. data/lib/rack/handler/lsws.rb +11 -11
  29. data/lib/rack/handler/scgi.rb +15 -15
  30. data/lib/rack/handler/thin.rb +3 -0
  31. data/lib/rack/handler/webrick.rb +24 -26
  32. data/lib/rack/head.rb +15 -17
  33. data/lib/rack/lint.rb +40 -40
  34. data/lib/rack/lobster.rb +1 -1
  35. data/lib/rack/lock.rb +6 -10
  36. data/lib/rack/logger.rb +2 -2
  37. data/lib/rack/media_type.rb +38 -0
  38. data/lib/rack/{methodoverride.rb → method_override.rb} +6 -10
  39. data/lib/rack/mime.rb +18 -5
  40. data/lib/rack/mock.rb +36 -54
  41. data/lib/rack/multipart.rb +35 -6
  42. data/lib/rack/multipart/generator.rb +5 -5
  43. data/lib/rack/multipart/parser.rb +272 -158
  44. data/lib/rack/multipart/uploaded_file.rb +1 -2
  45. data/lib/rack/{nulllogger.rb → null_logger.rb} +1 -1
  46. data/lib/rack/query_parser.rb +192 -0
  47. data/lib/rack/recursive.rb +8 -8
  48. data/lib/rack/request.rb +383 -307
  49. data/lib/rack/response.rb +130 -57
  50. data/lib/rack/rewindable_input.rb +1 -12
  51. data/lib/rack/runtime.rb +10 -18
  52. data/lib/rack/sendfile.rb +5 -7
  53. data/lib/rack/server.rb +30 -23
  54. data/lib/rack/session/abstract/id.rb +108 -138
  55. data/lib/rack/session/cookie.rb +26 -28
  56. data/lib/rack/session/memcache.rb +8 -14
  57. data/lib/rack/session/pool.rb +14 -21
  58. data/lib/rack/show_exceptions.rb +386 -0
  59. data/lib/rack/{showstatus.rb → show_status.rb} +3 -3
  60. data/lib/rack/static.rb +30 -5
  61. data/lib/rack/tempfile_reaper.rb +2 -2
  62. data/lib/rack/urlmap.rb +15 -14
  63. data/lib/rack/utils.rb +136 -211
  64. data/rack.gemspec +7 -5
  65. data/test/builder/an_underscore_app.rb +5 -0
  66. data/test/builder/options.ru +1 -1
  67. data/test/cgi/test.fcgi +1 -0
  68. data/test/cgi/test.gz +0 -0
  69. data/test/helper.rb +34 -0
  70. data/test/multipart/filename_with_encoded_words +7 -0
  71. data/test/multipart/filename_with_single_quote +7 -0
  72. data/test/multipart/quoted +15 -0
  73. data/test/multipart/rack-logo.png +0 -0
  74. data/test/multipart/unity3d_wwwform +11 -0
  75. data/test/registering_handler/rack/handler/registering_myself.rb +1 -1
  76. data/test/spec_auth_basic.rb +27 -19
  77. data/test/spec_auth_digest.rb +47 -46
  78. data/test/spec_body_proxy.rb +27 -27
  79. data/test/spec_builder.rb +51 -41
  80. data/test/spec_cascade.rb +24 -22
  81. data/test/spec_cgi.rb +49 -67
  82. data/test/spec_chunked.rb +37 -35
  83. data/test/{spec_commonlogger.rb → spec_common_logger.rb} +23 -21
  84. data/test/{spec_conditionalget.rb → spec_conditional_get.rb} +29 -28
  85. data/test/spec_config.rb +3 -2
  86. data/test/spec_content_length.rb +18 -17
  87. data/test/spec_content_type.rb +13 -12
  88. data/test/spec_deflater.rb +85 -49
  89. data/test/spec_directory.rb +87 -27
  90. data/test/spec_etag.rb +32 -31
  91. data/test/spec_events.rb +133 -0
  92. data/test/spec_fastcgi.rb +50 -72
  93. data/test/spec_file.rb +120 -77
  94. data/test/spec_handler.rb +19 -34
  95. data/test/spec_head.rb +15 -14
  96. data/test/spec_lint.rb +164 -199
  97. data/test/spec_lobster.rb +24 -23
  98. data/test/spec_lock.rb +69 -39
  99. data/test/spec_logger.rb +4 -3
  100. data/test/spec_media_type.rb +42 -0
  101. data/test/{spec_methodoverride.rb → spec_method_override.rb} +22 -37
  102. data/test/spec_mime.rb +19 -19
  103. data/test/spec_mock.rb +206 -144
  104. data/test/spec_multipart.rb +322 -200
  105. data/test/{spec_nulllogger.rb → spec_null_logger.rb} +5 -4
  106. data/test/spec_recursive.rb +17 -14
  107. data/test/spec_request.rb +768 -607
  108. data/test/spec_response.rb +215 -112
  109. data/test/spec_rewindable_input.rb +50 -40
  110. data/test/spec_runtime.rb +11 -10
  111. data/test/spec_sendfile.rb +30 -35
  112. data/test/spec_server.rb +78 -52
  113. data/test/spec_session_abstract_id.rb +11 -33
  114. data/test/spec_session_abstract_session_hash.rb +45 -0
  115. data/test/spec_session_cookie.rb +99 -67
  116. data/test/spec_session_memcache.rb +63 -101
  117. data/test/spec_session_pool.rb +48 -84
  118. data/test/spec_show_exceptions.rb +80 -0
  119. data/test/{spec_showstatus.rb → spec_show_status.rb} +36 -35
  120. data/test/spec_static.rb +71 -32
  121. data/test/spec_tempfile_reaper.rb +11 -10
  122. data/test/spec_thin.rb +55 -50
  123. data/test/spec_urlmap.rb +79 -78
  124. data/test/spec_utils.rb +441 -346
  125. data/test/spec_version.rb +2 -8
  126. data/test/spec_webrick.rb +93 -68
  127. data/test/static/foo.html +1 -0
  128. data/test/testrequest.rb +1 -1
  129. data/test/unregistered_handler/rack/handler/unregistered.rb +1 -1
  130. data/test/unregistered_handler/rack/handler/unregistered_long_one.rb +1 -1
  131. metadata +102 -66
  132. data/KNOWN-ISSUES +0 -44
  133. data/lib/rack/backports/uri/common_18.rb +0 -56
  134. data/lib/rack/backports/uri/common_192.rb +0 -52
  135. data/lib/rack/backports/uri/common_193.rb +0 -29
  136. data/lib/rack/handler/evented_mongrel.rb +0 -8
  137. data/lib/rack/handler/mongrel.rb +0 -106
  138. data/lib/rack/handler/swiftiplied_mongrel.rb +0 -8
  139. data/lib/rack/showexceptions.rb +0 -387
  140. data/lib/rack/utils/okjson.rb +0 -600
  141. data/test/spec_mongrel.rb +0 -182
  142. data/test/spec_showexceptions.rb +0 -98
@@ -1,81 +1,50 @@
1
1
  # AUTHOR: blink <blinketje@gmail.com>; blink#ruby-lang@irc.freenode.net
2
2
  # bugrep: Andreas Zehnder
3
3
 
4
+ require 'rack'
4
5
  require 'time'
5
6
  require 'rack/request'
6
7
  require 'rack/response'
7
- begin
8
- require 'securerandom'
9
- rescue LoadError
10
- # We just won't get securerandom
11
- end
12
- require "digest/sha2"
8
+ require 'securerandom'
13
9
 
14
10
  module Rack
15
11
 
16
12
  module Session
17
13
 
18
- class SessionId
19
- ID_VERSION = 2
20
-
21
- attr_reader :public_id
22
-
23
- def initialize(public_id)
24
- @public_id = public_id
25
- end
26
-
27
- def private_id
28
- "#{ID_VERSION}::#{hash_sid(public_id)}"
29
- end
30
-
31
- alias :cookie_value :public_id
32
-
33
- def empty?; false; end
34
- def to_s; raise; end
35
- def inspect; public_id.inspect; end
36
-
37
- private
38
-
39
- def hash_sid(sid)
40
- Digest::SHA256.hexdigest(sid)
41
- end
42
- end
43
-
44
14
  module Abstract
45
- ENV_SESSION_KEY = 'rack.session'.freeze
46
- ENV_SESSION_OPTIONS_KEY = 'rack.session.options'.freeze
47
-
48
15
  # SessionHash is responsible to lazily load the session from store.
49
16
 
50
17
  class SessionHash
51
18
  include Enumerable
52
19
  attr_writer :id
53
20
 
54
- def self.find(env)
55
- env[ENV_SESSION_KEY]
21
+ Unspecified = Object.new
22
+
23
+ def self.find(req)
24
+ req.get_header RACK_SESSION
56
25
  end
57
26
 
58
- def self.set(env, session)
59
- env[ENV_SESSION_KEY] = session
27
+ def self.set(req, session)
28
+ req.set_header RACK_SESSION, session
60
29
  end
61
30
 
62
- def self.set_options(env, options)
63
- env[ENV_SESSION_OPTIONS_KEY] = options.dup
31
+ def self.set_options(req, options)
32
+ req.set_header RACK_SESSION_OPTIONS, options.dup
64
33
  end
65
34
 
66
- def initialize(store, env)
35
+ def initialize(store, req)
67
36
  @store = store
68
- @env = env
37
+ @req = req
69
38
  @loaded = false
70
39
  end
71
40
 
72
41
  def id
73
42
  return @id if @loaded or instance_variable_defined?(:@id)
74
- @id = @store.send(:extract_session_id, @env)
43
+ @id = @store.send(:extract_session_id, @req)
75
44
  end
76
45
 
77
46
  def options
78
- @env[ENV_SESSION_OPTIONS_KEY]
47
+ @req.session_options
79
48
  end
80
49
 
81
50
  def each(&block)
@@ -87,7 +56,15 @@ module Rack
87
56
  load_for_read!
88
57
  @data[key.to_s]
89
58
  end
90
- alias :fetch :[]
59
+
60
+ def fetch(key, default=Unspecified, &block)
61
+ load_for_read!
62
+ if default == Unspecified
63
+ @data.fetch(key.to_s, &block)
64
+ else
65
+ @data.fetch(key.to_s, default, &block)
66
+ end
67
+ end
91
68
 
92
69
  def has_key?(key)
93
70
  load_for_read!
@@ -109,7 +86,7 @@ module Rack
109
86
 
110
87
  def destroy
111
88
  clear
112
- @id = @store.send(:destroy_session, @env, id, options)
89
+ @id = @store.send(:delete_session, @req, id, options)
113
90
  end
114
91
 
115
92
  def to_hash
@@ -144,7 +121,7 @@ module Rack
144
121
  def exists?
145
122
  return @exists if instance_variable_defined?(:@exists)
146
123
  @data = {}
147
- @exists = @store.send(:session_exists?, @env)
124
+ @exists = @store.send(:session_exists?, @req)
148
125
  end
149
126
 
150
127
  def loaded?
@@ -157,10 +134,12 @@ module Rack
157
134
  end
158
135
 
159
136
  def keys
137
+ load_for_read!
160
138
  @data.keys
161
139
  end
162
140
 
163
141
  def values
142
+ load_for_read!
164
143
  @data.values
165
144
  end
166
145
 
@@ -175,7 +154,7 @@ module Rack
175
154
  end
176
155
 
177
156
  def load!
178
- @id, session = @store.send(:load_session, @env)
157
+ @id, session = @store.send(:load_session, @req)
179
158
  @data = stringify_keys(session)
180
159
  @loaded = true
181
160
  end
@@ -191,14 +170,14 @@ module Rack
191
170
 
192
171
  # ID sets up a basic framework for implementing an id based sessioning
193
172
  # service. Cookies sent to the client for maintaining sessions will only
194
- # contain an id reference. Only #get_session and #set_session are
173
+ # contain an id reference. Only #find_session and #write_session are
195
174
  # required to be overwritten.
196
175
  #
197
176
  # All parameters are optional.
198
177
  # * :key determines the name of the cookie, by default it is
199
178
  # 'rack.session'
200
179
  # * :path, :domain, :expire_after, :secure, and :httponly set the related
201
- # cookie options as by Rack::Response#add_cookie
180
+ # cookie options as by Rack::Response#set_cookie
202
181
  # * :skip will not a set a cookie in the response nor update the session state
203
182
  # * :defer will not set a cookie in the response but still update the session
204
183
  # state if it is used with a backend
@@ -209,9 +188,9 @@ module Rack
209
188
  # id will be.
210
189
  #
211
190
  # These options can be set on a per request basis, at the location of
212
- # env['rack.session.options']. Additionally the id of the session can be
213
- # found within the options hash at the key :id. It is highly not
214
- # recommended to change its value.
191
+ # <tt>env['rack.session.options']</tt>. Additionally the id of the
192
+ # session can be found within the options hash at the key :id. It is
193
+ # highly not recommended to change its value.
215
194
  #
216
195
  # Is Rack::Utils::Context compatible.
217
196
  #
@@ -220,7 +199,7 @@ module Rack
220
199
 
221
200
  class Persisted
222
201
  DEFAULT_OPTIONS = {
223
- :key => 'rack.session',
202
+ :key => RACK_SESSION,
224
203
  :path => '/',
225
204
  :domain => nil,
226
205
  :expire_after => nil,
@@ -230,10 +209,10 @@ module Rack
230
209
  :renew => false,
231
210
  :sidbits => 128,
232
211
  :cookie_only => true,
233
- :secure_random => (::SecureRandom rescue false)
234
- }
212
+ :secure_random => ::SecureRandom
213
+ }.freeze
235
214
 
236
- attr_reader :key, :default_options
215
+ attr_reader :key, :default_options, :sid_secure
237
216
 
238
217
  def initialize(app, options={})
239
218
  @app = app
@@ -248,13 +227,20 @@ module Rack
248
227
  end
249
228
 
250
229
  def context(env, app=@app)
251
- prepare_session(env)
252
- status, headers, body = app.call(env)
253
- commit_session(env, status, headers, body)
230
+ req = make_request env
231
+ prepare_session(req)
232
+ status, headers, body = app.call(req.env)
233
+ res = Rack::Response::Raw.new status, headers
234
+ commit_session(req, res)
235
+ [status, headers, body]
254
236
  end
255
237
 
256
238
  private
257
239
 
240
+ def make_request(env)
241
+ Rack::Request.new env
242
+ end
243
+
258
244
  def initialize_sid
259
245
  @sidbits = @default_options[:sidbits]
260
246
  @sid_secure = @default_options[:secure_random]
@@ -278,26 +264,26 @@ module Rack
278
264
  # Sets the lazy session at 'rack.session' and places options and session
279
265
  # metadata into 'rack.session.options'.
280
266
 
281
- def prepare_session(env)
282
- session_was = env[ENV_SESSION_KEY]
283
- env[ENV_SESSION_KEY] = session_class.new(self, env)
284
- env[ENV_SESSION_OPTIONS_KEY] = @default_options.dup
285
- env[ENV_SESSION_KEY].merge! session_was if session_was
267
+ def prepare_session(req)
268
+ session_was = req.get_header RACK_SESSION
269
+ session = session_class.new(self, req)
270
+ req.set_header RACK_SESSION, session
271
+ req.set_header RACK_SESSION_OPTIONS, @default_options.dup
272
+ session.merge! session_was if session_was
286
273
  end
287
274
 
288
275
  # Extracts the session id from provided cookies and passes it and the
289
- # environment to #get_session.
276
+ # environment to #find_session.
290
277
 
291
- def load_session(env)
292
- sid = current_session_id(env)
293
- sid, session = get_session(env, sid)
278
+ def load_session(req)
279
+ sid = current_session_id(req)
280
+ sid, session = find_session(req, sid)
294
281
  [sid, session || {}]
295
282
  end
296
283
 
297
284
  # Extract session id from request object.
298
285
 
299
- def extract_session_id(env)
300
- request = Rack::Request.new(env)
286
+ def extract_session_id(request)
301
287
  sid = request.cookies[@key]
302
288
  sid ||= request.params[@key] unless @cookie_only
303
289
  sid
@@ -305,26 +291,26 @@ module Rack
305
291
 
306
292
  # Returns the current session id from the SessionHash.
307
293
 
308
- def current_session_id(env)
309
- env[ENV_SESSION_KEY].id
294
+ def current_session_id(req)
295
+ req.get_header(RACK_SESSION).id
310
296
  end
311
297
 
312
298
  # Check if the session exists or not.
313
299
 
314
- def session_exists?(env)
315
- value = current_session_id(env)
300
+ def session_exists?(req)
301
+ value = current_session_id(req)
316
302
  value && !value.empty?
317
303
  end
318
304
 
319
305
  # Session should be committed if it was loaded, any of specific options like :renew, :drop
320
306
  # or :expire_after was given and the security permissions match. Skips if skip is given.
321
307
 
322
- def commit_session?(env, session, options)
308
+ def commit_session?(req, session, options)
323
309
  if options[:skip]
324
310
  false
325
311
  else
326
312
  has_session = loaded_session?(session) || forced_session_update?(session, options)
327
- has_session && security_matches?(env, options)
313
+ has_session && security_matches?(req, options)
328
314
  end
329
315
  end
330
316
 
@@ -340,58 +326,52 @@ module Rack
340
326
  options.values_at(:max_age, :renew, :drop, :defer, :expire_after).any?
341
327
  end
342
328
 
343
- def security_matches?(env, options)
329
+ def security_matches?(request, options)
344
330
  return true unless options[:secure]
345
- request = Rack::Request.new(env)
346
331
  request.ssl?
347
332
  end
348
333
 
349
334
  # Acquires the session from the environment and the session id from
350
- # the session options and passes them to #set_session. If successful
335
+ # the session options and passes them to #write_session. If successful
351
336
  # and the :defer option is not true, a cookie will be added to the
352
337
  # response with the session's id.
353
338
 
354
- def commit_session(env, status, headers, body)
355
- session = env[ENV_SESSION_KEY]
339
+ def commit_session(req, res)
340
+ session = req.get_header RACK_SESSION
356
341
  options = session.options
357
342
 
358
343
  if options[:drop] || options[:renew]
359
- session_id = destroy_session(env, session.id || generate_sid, options)
360
- return [status, headers, body] unless session_id
344
+ session_id = delete_session(req, session.id || generate_sid, options)
345
+ return unless session_id
361
346
  end
362
347
 
363
- return [status, headers, body] unless commit_session?(env, session, options)
348
+ return unless commit_session?(req, session, options)
364
349
 
365
350
  session.send(:load!) unless loaded_session?(session)
366
351
  session_id ||= session.id
367
352
  session_data = session.to_hash.delete_if { |k,v| v.nil? }
368
353
 
369
- if not data = set_session(env, session_id, session_data, options)
370
- env["rack.errors"].puts("Warning! #{self.class.name} failed to save session. Content dropped.")
354
+ if not data = write_session(req, session_id, session_data, options)
355
+ req.get_header(RACK_ERRORS).puts("Warning! #{self.class.name} failed to save session. Content dropped.")
371
356
  elsif options[:defer] and not options[:renew]
372
- env["rack.errors"].puts("Deferring cookie for #{session_id.public_id}") if $VERBOSE
357
+ req.get_header(RACK_ERRORS).puts("Deferring cookie for #{session_id}") if $VERBOSE
373
358
  else
374
359
  cookie = Hash.new
375
- cookie[:value] = cookie_value(data)
360
+ cookie[:value] = data
376
361
  cookie[:expires] = Time.now + options[:expire_after] if options[:expire_after]
377
362
  cookie[:expires] = Time.now + options[:max_age] if options[:max_age]
378
- set_cookie(env, headers, cookie.merge!(options))
363
+ set_cookie(req, res, cookie.merge!(options))
379
364
  end
380
-
381
- [status, headers, body]
382
- end
383
-
384
- def cookie_value(data)
385
- data
386
365
  end
366
+ public :commit_session
387
367
 
388
368
  # Sets the cookie back to the client with session id. We skip the cookie
389
369
  # setting if the value didn't change (sid is the same) or expires was given.
390
370
 
391
- def set_cookie(env, headers, cookie)
392
- request = Rack::Request.new(env)
371
+ def set_cookie(request, res, cookie)
393
372
  if request.cookies[@key] != cookie[:value] || cookie[:expires]
394
- Utils.set_cookie_header!(headers, @key, cookie)
373
+ res.set_cookie_header =
374
+ Utils.add_cookie_to_header(res.set_cookie_header, @key, cookie)
395
375
  end
396
376
  end
397
377
 
@@ -406,68 +386,58 @@ module Rack
406
386
  # If nil is provided as the session id, generation of a new valid id
407
387
  # should occur within.
408
388
 
409
- def get_session(env, sid)
410
- raise '#get_session not implemented.'
389
+ def find_session(env, sid)
390
+ raise '#find_session not implemented.'
411
391
  end
412
392
 
413
393
  # All thread safety and session storage procedures should occur here.
414
394
  # Must return the session id if the session was saved successfully, or
415
395
  # false if the session could not be saved.
416
396
 
417
- def set_session(env, sid, session, options)
418
- raise '#set_session not implemented.'
397
+ def write_session(req, sid, session, options)
398
+ raise '#write_session not implemented.'
419
399
  end
420
400
 
421
401
  # All thread safety and session destroy procedures should occur here.
422
402
  # Should return a new session id or nil if options[:drop]
423
403
 
424
- def destroy_session(env, sid, options)
425
- raise '#destroy_session not implemented'
404
+ def delete_session(req, sid, options)
405
+ raise '#delete_session not implemented'
426
406
  end
427
407
  end
428
408
 
429
- class PersistedSecure < Persisted
430
- class SecureSessionHash < SessionHash
431
- def [](key)
432
- if key == "session_id"
433
- load_for_read!
434
- id.public_id
435
- else
436
- super
437
- end
409
+ class ID < Persisted
410
+ def self.inherited(klass)
411
+ k = klass.ancestors.find { |kl| kl.respond_to?(:superclass) && kl.superclass == ID }
412
+ unless k.instance_variable_defined?(:"@_rack_warned")
413
+ warn "#{klass} is inheriting from #{ID}. Inheriting from #{ID} is deprecated, please inherit from #{Persisted} instead" if $VERBOSE
414
+ k.instance_variable_set(:"@_rack_warned", true)
438
415
  end
416
+ super
439
417
  end
440
418
 
441
- def generate_sid(*)
442
- public_id = super
443
-
444
- SessionId.new(public_id)
445
- end
419
+ # All thread safety and session retrieval procedures should occur here.
420
+ # Should return [session_id, session].
421
+ # If nil is provided as the session id, generation of a new valid id
422
+ # should occur within.
446
423
 
447
- def extract_session_id(*)
448
- public_id = super
449
- public_id && SessionId.new(public_id)
424
+ def find_session(req, sid)
425
+ get_session req.env, sid
450
426
  end
451
427
 
452
- private
428
+ # All thread safety and session storage procedures should occur here.
429
+ # Must return the session id if the session was saved successfully, or
430
+ # false if the session could not be saved.
453
431
 
454
- def session_class
455
- SecureSessionHash
432
+ def write_session(req, sid, session, options)
433
+ set_session req.env, sid, session, options
456
434
  end
457
435
 
458
- def cookie_value(data)
459
- data.cookie_value
460
- end
461
- end
436
+ # All thread safety and session destroy procedures should occur here.
437
+ # Should return a new session id or nil if options[:drop]
462
438
 
463
- class ID < Persisted
464
- def self.inherited(klass)
465
- k = klass.ancestors.find { |kl| kl.respond_to?(:superclass) && kl.superclass == ID }
466
- unless k.instance_variable_defined?(:"@_rack_warned")
467
- warn "#{klass} is inheriting from #{ID}. Inheriting from #{ID} is deprecated, please inherit from #{Persisted} instead" if $VERBOSE
468
- k.instance_variable_set(:"@_rack_warned", true)
469
- end
470
- super
439
+ def delete_session(req, sid, options)
440
+ destroy_session req.env, sid, options
471
441
  end
472
442
  end
473
443
  end