rack 2.1.3 → 2.2.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.

Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +613 -1
  3. data/CONTRIBUTING.md +136 -0
  4. data/README.rdoc +83 -39
  5. data/Rakefile +14 -7
  6. data/{SPEC → SPEC.rdoc} +26 -1
  7. data/lib/rack.rb +7 -16
  8. data/lib/rack/auth/abstract/request.rb +0 -2
  9. data/lib/rack/auth/basic.rb +3 -3
  10. data/lib/rack/auth/digest/md5.rb +4 -4
  11. data/lib/rack/auth/digest/request.rb +3 -3
  12. data/lib/rack/body_proxy.rb +13 -9
  13. data/lib/rack/builder.rb +77 -8
  14. data/lib/rack/cascade.rb +23 -8
  15. data/lib/rack/chunked.rb +48 -23
  16. data/lib/rack/common_logger.rb +25 -18
  17. data/lib/rack/conditional_get.rb +18 -16
  18. data/lib/rack/content_length.rb +6 -7
  19. data/lib/rack/content_type.rb +3 -4
  20. data/lib/rack/deflater.rb +45 -35
  21. data/lib/rack/directory.rb +77 -59
  22. data/lib/rack/etag.rb +2 -3
  23. data/lib/rack/events.rb +15 -18
  24. data/lib/rack/file.rb +1 -1
  25. data/lib/rack/files.rb +96 -56
  26. data/lib/rack/handler/cgi.rb +1 -4
  27. data/lib/rack/handler/fastcgi.rb +1 -3
  28. data/lib/rack/handler/lsws.rb +1 -3
  29. data/lib/rack/handler/scgi.rb +1 -3
  30. data/lib/rack/handler/thin.rb +15 -11
  31. data/lib/rack/handler/webrick.rb +12 -5
  32. data/lib/rack/head.rb +0 -2
  33. data/lib/rack/lint.rb +57 -14
  34. data/lib/rack/lobster.rb +3 -5
  35. data/lib/rack/lock.rb +0 -1
  36. data/lib/rack/mock.rb +22 -4
  37. data/lib/rack/multipart.rb +1 -1
  38. data/lib/rack/multipart/generator.rb +11 -6
  39. data/lib/rack/multipart/parser.rb +7 -15
  40. data/lib/rack/multipart/uploaded_file.rb +13 -7
  41. data/lib/rack/query_parser.rb +7 -8
  42. data/lib/rack/recursive.rb +1 -1
  43. data/lib/rack/reloader.rb +1 -3
  44. data/lib/rack/request.rb +182 -76
  45. data/lib/rack/response.rb +62 -19
  46. data/lib/rack/rewindable_input.rb +0 -1
  47. data/lib/rack/runtime.rb +3 -3
  48. data/lib/rack/sendfile.rb +0 -3
  49. data/lib/rack/server.rb +9 -8
  50. data/lib/rack/session/abstract/id.rb +20 -18
  51. data/lib/rack/session/cookie.rb +2 -3
  52. data/lib/rack/session/pool.rb +1 -1
  53. data/lib/rack/show_exceptions.rb +2 -4
  54. data/lib/rack/show_status.rb +1 -3
  55. data/lib/rack/static.rb +13 -6
  56. data/lib/rack/tempfile_reaper.rb +0 -2
  57. data/lib/rack/urlmap.rb +1 -4
  58. data/lib/rack/utils.rb +58 -54
  59. data/lib/rack/version.rb +29 -0
  60. data/rack.gemspec +31 -29
  61. metadata +11 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 83025be71b5d57dbb184eb3d2364c727dad01c2214f683377dec5fdb3de0bc7d
4
- data.tar.gz: c672e59748bb0b5412f017260168b7cd718f99c6bc7fc7ec2fd374d21b5dc7e3
3
+ metadata.gz: ecd99d8eb4cb36d36f656ff9f0d688f5e97cfc9c219ea61daf75cc11c5b213fe
4
+ data.tar.gz: d61d3ae82e127877da8629b4d8f36fb8007b51793589c864f9632aed55bdc5fd
5
5
  SHA512:
6
- metadata.gz: 9e3eecfe73f0dc2def1653c47d84dc9d044395ffed4a4021ac5dfd565267f214264c06efec8ef84fec3159a0e793acf6190ecf151280ab544cbb852eb32db168
7
- data.tar.gz: 9c64bdf7f521ef19170025a24627f0e59ea3f18be605da7e623027928f153c1a3a71fc001695d52e99d153a3d50f11ef9b13c11223c3245bbf0a5cc3f10f2e57
6
+ metadata.gz: 4e2b43fae3062393ce93b0a9624177551a5aca4cb537203a99245b37ad97417f7f4e5d593ace93068cda6b8cce5fb111496caf46af90ff4ab16082b1d6927bd0
7
+ data.tar.gz: 43f899d6905c51240e5b2ba429818a025596a0a7cdb7b447a3f2760c8af50999387d7f198e7a553befd82eb66784e16ad6cb8f6720e300904388fb07b6365917
@@ -1,3 +1,97 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file. For info on how to format all future additions to this file please reference [Keep A Changelog](https://keepachangelog.com/en/1.0.0/).
4
+
5
+ ## [2.2.1] - 2020-02-09
6
+
7
+ ### Fixed
8
+
9
+ - Rework `Rack::Request#ip` to handle empty `forwarded_for`. ([#1577](https://github.com/rack/rack/pull/1577), [@ioquatix](https://github.com/ioquatix))
10
+
11
+ ## [2.2.0] - 2020-02-08
12
+
13
+ ### SPEC Changes
14
+
15
+ - `rack.session` request environment entry must respond to `to_hash` and return unfrozen Hash. ([@jeremyevans](https://github.com/jeremyevans))
16
+ - Request environment cannot be frozen. ([@jeremyevans](https://github.com/jeremyevans))
17
+ - CGI values in the request environment with non-ASCII characters must use ASCII-8BIT encoding. ([@jeremyevans](https://github.com/jeremyevans))
18
+ - Improve SPEC/lint relating to SERVER_NAME, SERVER_PORT and HTTP_HOST. ([#1561](https://github.com/rack/rack/pull/1561), [@ioquatix](https://github.com/ioquatix))
19
+
20
+ ### Added
21
+
22
+ - `rackup` supports multiple `-r` options and will require all arguments. ([@jeremyevans](https://github.com/jeremyevans))
23
+ - `Server` supports an array of paths to require for the `:require` option. ([@khotta](https://github.com/khotta))
24
+ - `Files` supports multipart range requests. ([@fatkodima](https://github.com/fatkodima))
25
+ - `Multipart::UploadedFile` supports an IO-like object instead of using the filesystem, using `:filename` and `:io` options. ([@jeremyevans](https://github.com/jeremyevans))
26
+ - `Multipart::UploadedFile` supports keyword arguments `:path`, `:content_type`, and `:binary` in addition to positional arguments. ([@jeremyevans](https://github.com/jeremyevans))
27
+ - `Static` supports a `:cascade` option for calling the app if there is no matching file. ([@jeremyevans](https://github.com/jeremyevans))
28
+ - `Session::Abstract::SessionHash#dig`. ([@jeremyevans](https://github.com/jeremyevans))
29
+ - `Response.[]` and `MockResponse.[]` for creating instances using status, headers, and body. ([@ioquatix](https://github.com/ioquatix))
30
+ - Convenient cache and content type methods for `Rack::Response`. ([#1555](https://github.com/rack/rack/pull/1555), [@ioquatix](https://github.com/ioquatix))
31
+
32
+ ### Changed
33
+
34
+ - `Request#params` no longer rescues EOFError. ([@jeremyevans](https://github.com/jeremyevans))
35
+ - `Directory` uses a streaming approach, significantly improving time to first byte for large directories. ([@jeremyevans](https://github.com/jeremyevans))
36
+ - `Directory` no longer includes a Parent directory link in the root directory index. ([@jeremyevans](https://github.com/jeremyevans))
37
+ - `QueryParser#parse_nested_query` uses original backtrace when reraising exception with new class. ([@jeremyevans](https://github.com/jeremyevans))
38
+ - `ConditionalGet` follows RFC 7232 precedence if both If-None-Match and If-Modified-Since headers are provided. ([@jeremyevans](https://github.com/jeremyevans))
39
+ - `.ru` files supports the `frozen-string-literal` magic comment. ([@eregon](https://github.com/eregon))
40
+ - Rely on autoload to load constants instead of requiring internal files, make sure to require 'rack' and not just 'rack/...'. ([@jeremyevans](https://github.com/jeremyevans))
41
+ - `Etag` will continue sending ETag even if the response should not be cached. ([@henm](https://github.com/henm))
42
+ - `Request#host_with_port` no longer includes a colon for a missing or empty port. ([@AlexWayfer](https://github.com/AlexWayfer))
43
+ - All handlers uses keywords arguments instead of an options hash argument. ([@ioquatix](https://github.com/ioquatix))
44
+ - `Files` handling of range requests no longer return a body that supports `to_path`, to ensure range requests are handled correctly. ([@jeremyevans](https://github.com/jeremyevans))
45
+ - `Multipart::Generator` only includes `Content-Length` for files with paths, and `Content-Disposition` `filename` if the `UploadedFile` instance has one. ([@jeremyevans](https://github.com/jeremyevans))
46
+ - `Request#ssl?` is true for the `wss` scheme (secure websockets). ([@jeremyevans](https://github.com/jeremyevans))
47
+ - `Rack::HeaderHash` is memoized by default. ([#1549](https://github.com/rack/rack/pull/1549), [@ioquatix](https://github.com/ioquatix))
48
+ - `Rack::Directory` allow directory traversal inside root directory. ([#1417](https://github.com/rack/rack/pull/1417), [@ThomasSevestre](https://github.com/ThomasSevestre))
49
+ - Sort encodings by server preference. ([#1184](https://github.com/rack/rack/pull/1184), [@ioquatix](https://github.com/ioquatix), [@wjordan](https://github.com/wjordan))
50
+ - Rework host/hostname/authority implementation in `Rack::Request`. `#host` and `#host_with_port` have been changed to correctly return IPv6 addresses formatted with square brackets, as defined by [RFC3986](https://tools.ietf.org/html/rfc3986#section-3.2.2). ([#1561](https://github.com/rack/rack/pull/1561), [@ioquatix](https://github.com/ioquatix))
51
+ - `Rack::Builder` parsing options on first `#\` line is deprecated. ([#1574](https://github.com/rack/rack/pull/1574), [@ioquatix](https://github.com/ioquatix))
52
+
53
+ ### Removed
54
+
55
+ - `Directory#path` as it was not used and always returned nil. ([@jeremyevans](https://github.com/jeremyevans))
56
+ - `BodyProxy#each` as it was only needed to work around a bug in Ruby <1.9.3. ([@jeremyevans](https://github.com/jeremyevans))
57
+ - `URLMap::INFINITY` and `URLMap::NEGATIVE_INFINITY`, in favor of `Float::INFINITY`. ([@ch1c0t](https://github.com/ch1c0t))
58
+ - Deprecation of `Rack::File`. It will be deprecated again in rack 2.2 or 3.0. ([@rafaelfranca](https://github.com/rafaelfranca))
59
+ - Support for Ruby 2.2 as it is well past EOL. ([@ioquatix](https://github.com/ioquatix))
60
+ - Remove `Rack::Files#response_body` as the implementation was broken. ([#1153](https://github.com/rack/rack/pull/1153), [@ioquatix](https://github.com/ioquatix))
61
+ - Remove `SERVER_ADDR` which was never part of the original SPEC. ([#1573](https://github.com/rack/rack/pull/1573), [@ioquatix](https://github.com/ioquatix))
62
+
63
+ ### Fixed
64
+
65
+ - `Directory` correctly handles root paths containing glob metacharacters. ([@jeremyevans](https://github.com/jeremyevans))
66
+ - `Cascade` uses a new response object for each call if initialized with no apps. ([@jeremyevans](https://github.com/jeremyevans))
67
+ - `BodyProxy` correctly delegates keyword arguments to the body object on Ruby 2.7+. ([@jeremyevans](https://github.com/jeremyevans))
68
+ - `BodyProxy#method` correctly handles methods delegated to the body object. ([@jeremyevans](https://github.com/jeremyevans))
69
+ - `Request#host` and `Request#host_with_port` handle IPv6 addresses correctly. ([@AlexWayfer](https://github.com/AlexWayfer))
70
+ - `Lint` checks when response hijacking that `rack.hijack` is called with a valid object. ([@jeremyevans](https://github.com/jeremyevans))
71
+ - `Response#write` correctly updates `Content-Length` if initialized with a body. ([@jeremyevans](https://github.com/jeremyevans))
72
+ - `CommonLogger` includes `SCRIPT_NAME` when logging. ([@Erol](https://github.com/Erol))
73
+ - `Utils.parse_nested_query` correctly handles empty queries, using an empty instance of the params class instead of a hash. ([@jeremyevans](https://github.com/jeremyevans))
74
+ - `Directory` correctly escapes paths in links. ([@yous](https://github.com/yous))
75
+ - `Request#delete_cookie` and related `Utils` methods handle `:domain` and `:path` options in same call. ([@jeremyevans](https://github.com/jeremyevans))
76
+ - `Request#delete_cookie` and related `Utils` methods do an exact match on `:domain` and `:path` options. ([@jeremyevans](https://github.com/jeremyevans))
77
+ - `Static` no longer adds headers when a gzipped file request has a 304 response. ([@chooh](https://github.com/chooh))
78
+ - `ContentLength` sets `Content-Length` response header even for bodies not responding to `to_ary`. ([@jeremyevans](https://github.com/jeremyevans))
79
+ - Thin handler supports options passed directly to `Thin::Controllers::Controller`. ([@jeremyevans](https://github.com/jeremyevans))
80
+ - WEBrick handler no longer ignores `:BindAddress` option. ([@jeremyevans](https://github.com/jeremyevans))
81
+ - `ShowExceptions` handles invalid POST data. ([@jeremyevans](https://github.com/jeremyevans))
82
+ - Basic authentication requires a password, even if the password is empty. ([@jeremyevans](https://github.com/jeremyevans))
83
+ - `Lint` checks response is array with 3 elements, per SPEC. ([@jeremyevans](https://github.com/jeremyevans))
84
+ - Support for using `:SSLEnable` option when using WEBrick handler. (Gregor Melhorn)
85
+ - Close response body after buffering it when buffering. ([@ioquatix](https://github.com/ioquatix))
86
+ - Only accept `;` as delimiter when parsing cookies. ([@mrageh](https://github.com/mrageh))
87
+ - `Utils::HeaderHash#clear` clears the name mapping as well. ([@raxoft](https://github.com/raxoft))
88
+ - Support for passing `nil` `Rack::Files.new`, which notably fixes Rails' current `ActiveStorage::FileServer` implementation. ([@ioquatix](https://github.com/ioquatix))
89
+
90
+ ### Documentation
91
+
92
+ - CHANGELOG updates. ([@aupajo](https://github.com/aupajo))
93
+ - Added [CONTRIBUTING](CONTRIBUTING.md). ([@dblock](https://github.com/dblock))
94
+
1
95
  ## [2.1.2] - 2020-01-27
2
96
 
3
97
  - Fix multipart parser for some files to prevent denial of service ([@aiomaster](https://github.com/aiomaster))
@@ -10,6 +104,7 @@
10
104
  ## [2.1.1] - 2020-01-12
11
105
 
12
106
  - Remove `Rack::Chunked` from `Rack::Server` default middleware. ([#1475](https://github.com/rack/rack/pull/1475), [@ioquatix](https://github.com/ioquatix))
107
+ - Restore support for code relying on `SessionId#to_s`. ([@jeremyevans](https://github.com/jeremyevans))
13
108
 
14
109
  ## [2.1.0] - 2020-01-10
15
110
 
@@ -63,7 +158,524 @@
63
158
  ### Documentation
64
159
 
65
160
  - Update broken example in `Session::Abstract::ID` documentation. ([tonytonyjan](https://github.com/tonytonyjan))
66
- - Add Padrino to the list of frameworks implmenting Rack. ([@wikimatze](https://github.com/wikimatze))
161
+ - Add Padrino to the list of frameworks implementing Rack. ([@wikimatze](https://github.com/wikimatze))
67
162
  - Remove Mongrel from the suggested server options in the help output. ([@tricknotes](https://github.com/tricknotes))
68
163
  - Replace `HISTORY.md` and `NEWS.md` with `CHANGELOG.md`. ([@twitnithegirl](https://github.com/twitnithegirl))
69
164
  - CHANGELOG updates. ([@drenmi](https://github.com/Drenmi), [@p8](https://github.com/p8))
165
+
166
+ ## [2.0.8] - 2019-12-08
167
+
168
+ ### Security
169
+
170
+ - [[CVE-2019-16782](https://nvd.nist.gov/vuln/detail/CVE-2019-16782)] Prevent timing attacks targeted at session ID lookup. BREAKING CHANGE: Session ID is now a SessionId instance instead of a String. ([@tenderlove](https://github.com/tenderlove), [@rafaelfranca](https://github.com/rafaelfranca))
171
+
172
+ ## [1.6.12] - 2019-12-08
173
+
174
+ ### Security
175
+
176
+ - [[CVE-2019-16782](https://nvd.nist.gov/vuln/detail/CVE-2019-16782)] Prevent timing attacks targeted at session ID lookup. BREAKING CHANGE: Session ID is now a SessionId instance instead of a String. ([@tenderlove](https://github.com/tenderlove), [@rafaelfranca](https://github.com/rafaelfranca))
177
+
178
+ ## [2.0.7] - 2019-04-02
179
+
180
+ ### Fixed
181
+
182
+ - Remove calls to `#eof?` on Rack input in `Multipart::Parser`, as this breaks the specification. ([@matthewd](https://github.com/matthewd))
183
+ - Preserve forwarded IP addresses for trusted proxy chains. ([@SamSaffron](https://github.com/SamSaffron))
184
+
185
+ ## [2.0.6] - 2018-11-05
186
+
187
+ ### Fixed
188
+
189
+ - [[CVE-2018-16470](https://nvd.nist.gov/vuln/detail/CVE-2018-16470)] Reduce buffer size of `Multipart::Parser` to avoid pathological parsing. ([@tenderlove](https://github.com/tenderlove))
190
+ - Fix a call to a non-existing method `#accepts_html` in the `ShowExceptions` middleware. ([@tomelm](https://github.com/tomelm))
191
+ - [[CVE-2018-16471](https://nvd.nist.gov/vuln/detail/CVE-2018-16471)] Whitelist HTTP and HTTPS schemes in `Request#scheme` to prevent a possible XSS attack. ([@PatrickTulskie](https://github.com/PatrickTulskie))
192
+
193
+ ## [2.0.5] - 2018-04-23
194
+
195
+ ### Fixed
196
+
197
+ - Record errors originating from invalid UTF8 in `MethodOverride` middleware instead of breaking. ([@mclark](https://github.com/mclark))
198
+
199
+ ## [2.0.4] - 2018-01-31
200
+
201
+ ### Changed
202
+
203
+ - Ensure the `Lock` middleware passes the original `env` object. ([@lugray](https://github.com/lugray))
204
+ - Improve performance of `Multipart::Parser` when uploading large files. ([@tompng](https://github.com/tompng))
205
+ - Increase buffer size in `Multipart::Parser` for better performance. ([@jkowens](https://github.com/jkowens))
206
+ - Reduce memory usage of `Multipart::Parser` when uploading large files. ([@tompng](https://github.com/tompng))
207
+ - Replace ConcurrentRuby dependency with native `Queue`. ([@devmchakan](https://github.com/devmchakan))
208
+
209
+ ### Fixed
210
+
211
+ - Require the correct digest algorithm in the `ETag` middleware. ([@matthewd](https://github.com/matthewd))
212
+
213
+ ### Documentation
214
+
215
+ - Update homepage links to use SSL. ([@hugoabonizio](https://github.com/hugoabonizio))
216
+
217
+ ## [2.0.3] - 2017-05-15
218
+
219
+ ### Changed
220
+
221
+ - Ensure `env` values are ASCII 8-bit encoded. ([@eileencodes](https://github.com/eileencodes))
222
+
223
+ ### Fixed
224
+
225
+ - Prevent exceptions when a class with mixins inherits from `Session::Abstract::ID`. ([@jnraine](https://github.com/jnraine))
226
+
227
+ ## [2.0.2] - 2017-05-08
228
+
229
+ ### Added
230
+
231
+ - Allow `Session::Abstract::SessionHash#fetch` to accept a block with a default value. ([@yannvanhalewyn](https://github.com/yannvanhalewyn))
232
+ - Add `Builder#freeze_app` to freeze application and all middleware. ([@jeremyevans](https://github.com/jeremyevans))
233
+
234
+ ### Changed
235
+
236
+ - Freeze default session options to avoid accidental mutation. ([@kirs](https://github.com/kirs))
237
+ - Detect partial hijack without hash headers. ([@devmchakan](https://github.com/devmchakan))
238
+ - Update tests to use MiniTest 6 matchers. ([@tonytonyjan](https://github.com/tonytonyjan))
239
+ - Allow 205 Reset Content responses to set a Content-Length, as RFC 7231 proposes setting this to 0. ([@devmchakan](https://github.com/devmchakan))
240
+
241
+ ### Fixed
242
+
243
+ - Handle `NULL` bytes in multipart filenames. ([@casperisfine](https://github.com/casperisfine))
244
+ - Remove warnings due to miscapitalized global. ([@ioquatix](https://github.com/ioquatix))
245
+ - Prevent exceptions caused by a race condition on multi-threaded servers. ([@sophiedeziel](https://github.com/sophiedeziel))
246
+ - Add RDoc as an explicit depencency for `doc` group. ([@tonytonyjan](https://github.com/tonytonyjan))
247
+ - Record errors originating from `Multipart::Parser` in the `MethodOverride` middleware instead of letting them bubble up. ([@carlzulauf](https://github.com/carlzulauf))
248
+ - Remove remaining use of removed `Utils#bytesize` method from the `File` middleware. ([@brauliomartinezlm](https://github.com/brauliomartinezlm))
249
+
250
+ ### Removed
251
+
252
+ - Remove `deflate` encoding support to reduce caching overhead. ([@devmchakan](https://github.com/devmchakan))
253
+
254
+ ### Documentation
255
+
256
+ - Update broken example in `Deflater` documentation. ([@mwpastore](https://github.com/mwpastore))
257
+
258
+ ## [2.0.1] - 2016-06-30
259
+
260
+ ### Changed
261
+
262
+ - Remove JSON as an explicit dependency. ([@mperham](https://github.com/mperham))
263
+
264
+
265
+ # History/News Archive
266
+ Items below this line are from the previously maintained HISTORY.md and NEWS.md files.
267
+
268
+ ## [2.0.0.rc1] 2016-05-06
269
+ - Rack::Session::Abstract::ID is deprecated. Please change to use Rack::Session::Abstract::Persisted
270
+
271
+ ## [2.0.0.alpha] 2015-12-04
272
+ - First-party "SameSite" cookies. Browsers omit SameSite cookies from third-party requests, closing the door on many CSRF attacks.
273
+ - Pass `same_site: true` (or `:strict`) to enable: response.set_cookie 'foo', value: 'bar', same_site: true or `same_site: :lax` to use Lax enforcement: response.set_cookie 'foo', value: 'bar', same_site: :lax
274
+ - Based on version 7 of the Same-site Cookies internet draft:
275
+ https://tools.ietf.org/html/draft-west-first-party-cookies-07
276
+ - Thanks to Ben Toews (@mastahyeti) and Bob Long (@bobjflong) for updating to drafts 5 and 7.
277
+ - Add `Rack::Events` middleware for adding event based middleware: middleware that does not care about the response body, but only cares about doing work at particular points in the request / response lifecycle.
278
+ - Add `Rack::Request#authority` to calculate the authority under which the response is being made (this will be handy for h2 pushes).
279
+ - Add `Rack::Response::Helpers#cache_control` and `cache_control=`. Use this for setting cache control headers on your response objects.
280
+ - Add `Rack::Response::Helpers#etag` and `etag=`. Use this for setting etag values on the response.
281
+ - Introduce `Rack::Response::Helpers#add_header` to add a value to a multi-valued response header. Implemented in terms of other `Response#*_header` methods, so it's available to any response-like class that includes the `Helpers` module.
282
+ - Add `Rack::Request#add_header` to match.
283
+ - `Rack::Session::Abstract::ID` IS DEPRECATED. Please switch to `Rack::Session::Abstract::Persisted`. `Rack::Session::Abstract::Persisted` uses a request object rather than the `env` hash.
284
+ - Pull `ENV` access inside the request object in to a module. This will help with legacy Request objects that are ENV based but don't want to inherit from Rack::Request
285
+ - Move most methods on the `Rack::Request` to a module `Rack::Request::Helpers` and use public API to get values from the request object. This enables users to mix `Rack::Request::Helpers` in to their own objects so they can implement `(get|set|fetch|each)_header` as they see fit (for example a proxy object).
286
+ - Files and directories with + in the name are served correctly. Rather than unescaping paths like a form, we unescape with a URI parser using `Rack::Utils.unescape_path`. Fixes #265
287
+ - Tempfiles are automatically closed in the case that there were too
288
+ many posted.
289
+ - Added methods for manipulating response headers that don't assume
290
+ they're stored as a Hash. Response-like classes may include the
291
+ Rack::Response::Helpers module if they define these methods:
292
+ - Rack::Response#has_header?
293
+ - Rack::Response#get_header
294
+ - Rack::Response#set_header
295
+ - Rack::Response#delete_header
296
+ - Introduce Util.get_byte_ranges that will parse the value of the HTTP_RANGE string passed to it without depending on the `env` hash. `byte_ranges` is deprecated in favor of this method.
297
+ - Change Session internals to use Request objects for looking up session information. This allows us to only allocate one request object when dealing with session objects (rather than doing it every time we need to manipulate cookies, etc).
298
+ - Add `Rack::Request#initialize_copy` so that the env is duped when the request gets duped.
299
+ - Added methods for manipulating request specific data. This includes
300
+ data set as CGI parameters, and just any arbitrary data the user wants
301
+ to associate with a particular request. New methods:
302
+ - Rack::Request#has_header?
303
+ - Rack::Request#get_header
304
+ - Rack::Request#fetch_header
305
+ - Rack::Request#each_header
306
+ - Rack::Request#set_header
307
+ - Rack::Request#delete_header
308
+ - lib/rack/utils.rb: add a method for constructing "delete" cookie
309
+ headers. This allows us to construct cookie headers without depending
310
+ on the side effects of mutating a hash.
311
+ - Prevent extremely deep parameters from being parsed. CVE-2015-3225
312
+
313
+ ## [1.6.1] 2015-05-06
314
+ - Fix CVE-2014-9490, denial of service attack in OkJson
315
+ - Use a monotonic time for Rack::Runtime, if available
316
+ - RACK_MULTIPART_LIMIT changed to RACK_MULTIPART_PART_LIMIT (RACK_MULTIPART_LIMIT is deprecated and will be removed in 1.7.0)
317
+
318
+ ## [1.5.3] 2015-05-06
319
+ - Fix CVE-2014-9490, denial of service attack in OkJson
320
+ - Backport bug fixes to 1.5 series
321
+
322
+ ## [1.6.0] 2014-01-18
323
+ - Response#unauthorized? helper
324
+ - Deflater now accepts an options hash to control compression on a per-request level
325
+ - Builder#warmup method for app preloading
326
+ - Request#accept_language method to extract HTTP_ACCEPT_LANGUAGE
327
+ - Add quiet mode of rack server, rackup --quiet
328
+ - Update HTTP Status Codes to RFC 7231
329
+ - Less strict header name validation according to RFC 2616
330
+ - SPEC updated to specify headers conform to RFC7230 specification
331
+ - Etag correctly marks etags as weak
332
+ - Request#port supports multiple x-http-forwarded-proto values
333
+ - Utils#multipart_part_limit configures the maximum number of parts a request can contain
334
+ - Default host to localhost when in development mode
335
+ - Various bugfixes and performance improvements
336
+
337
+ ## [1.5.2] 2013-02-07
338
+ - Fix CVE-2013-0263, timing attack against Rack::Session::Cookie
339
+ - Fix CVE-2013-0262, symlink path traversal in Rack::File
340
+ - Add various methods to Session for enhanced Rails compatibility
341
+ - Request#trusted_proxy? now only matches whole strings
342
+ - Add JSON cookie coder, to be default in Rack 1.6+ due to security concerns
343
+ - URLMap host matching in environments that don't set the Host header fixed
344
+ - Fix a race condition that could result in overwritten pidfiles
345
+ - Various documentation additions
346
+
347
+ ## [1.4.5] 2013-02-07
348
+ - Fix CVE-2013-0263, timing attack against Rack::Session::Cookie
349
+ - Fix CVE-2013-0262, symlink path traversal in Rack::File
350
+
351
+ ## [1.1.6, 1.2.8, 1.3.10] 2013-02-07
352
+ - Fix CVE-2013-0263, timing attack against Rack::Session::Cookie
353
+
354
+ ## [1.5.1] 2013-01-28
355
+ - Rack::Lint check_hijack now conforms to other parts of SPEC
356
+ - Added hash-like methods to Abstract::ID::SessionHash for compatibility
357
+ - Various documentation corrections
358
+
359
+ ## [1.5.0] 2013-01-21
360
+ - Introduced hijack SPEC, for before-response and after-response hijacking
361
+ - SessionHash is no longer a Hash subclass
362
+ - Rack::File cache_control parameter is removed, in place of headers options
363
+ - Rack::Auth::AbstractRequest#scheme now yields strings, not symbols
364
+ - Rack::Utils cookie functions now format expires in RFC 2822 format
365
+ - Rack::File now has a default mime type
366
+ - rackup -b 'run Rack::Files.new(".")', option provides command line configs
367
+ - Rack::Deflater will no longer double encode bodies
368
+ - Rack::Mime#match? provides convenience for Accept header matching
369
+ - Rack::Utils#q_values provides splitting for Accept headers
370
+ - Rack::Utils#best_q_match provides a helper for Accept headers
371
+ - Rack::Handler.pick provides convenience for finding available servers
372
+ - Puma added to the list of default servers (preferred over Webrick)
373
+ - Various middleware now correctly close body when replacing it
374
+ - Rack::Request#params is no longer persistent with only GET params
375
+ - Rack::Request#update_param and #delete_param provide persistent operations
376
+ - Rack::Request#trusted_proxy? now returns true for local unix sockets
377
+ - Rack::Response no longer forces Content-Types
378
+ - Rack::Sendfile provides local mapping configuration options
379
+ - Rack::Utils#rfc2109 provides old netscape style time output
380
+ - Updated HTTP status codes
381
+ - Ruby 1.8.6 likely no longer passes tests, and is no longer fully supported
382
+
383
+ ## [1.4.4, 1.3.9, 1.2.7, 1.1.5] 2013-01-13
384
+ - [SEC] Rack::Auth::AbstractRequest no longer symbolizes arbitrary strings
385
+ - Fixed erroneous test case in the 1.3.x series
386
+
387
+ ## [1.4.3] 2013-01-07
388
+ - Security: Prevent unbounded reads in large multipart boundaries
389
+
390
+ ## [1.3.8] 2013-01-07
391
+ - Security: Prevent unbounded reads in large multipart boundaries
392
+
393
+ ## [1.4.2] 2013-01-06
394
+ - Add warnings when users do not provide a session secret
395
+ - Fix parsing performance for unquoted filenames
396
+ - Updated URI backports
397
+ - Fix URI backport version matching, and silence constant warnings
398
+ - Correct parameter parsing with empty values
399
+ - Correct rackup '-I' flag, to allow multiple uses
400
+ - Correct rackup pidfile handling
401
+ - Report rackup line numbers correctly
402
+ - Fix request loops caused by non-stale nonces with time limits
403
+ - Fix reloader on Windows
404
+ - Prevent infinite recursions from Response#to_ary
405
+ - Various middleware better conforms to the body close specification
406
+ - Updated language for the body close specification
407
+ - Additional notes regarding ECMA escape compatibility issues
408
+ - Fix the parsing of multiple ranges in range headers
409
+ - Prevent errors from empty parameter keys
410
+ - Added PATCH verb to Rack::Request
411
+ - Various documentation updates
412
+ - Fix session merge semantics (fixes rack-test)
413
+ - Rack::Static :index can now handle multiple directories
414
+ - All tests now utilize Rack::Lint (special thanks to Lars Gierth)
415
+ - Rack::File cache_control parameter is now deprecated, and removed by 1.5
416
+ - Correct Rack::Directory script name escaping
417
+ - Rack::Static supports header rules for sophisticated configurations
418
+ - Multipart parsing now works without a Content-Length header
419
+ - New logos courtesy of Zachary Scott!
420
+ - Rack::BodyProxy now explicitly defines #each, useful for C extensions
421
+ - Cookies that are not URI escaped no longer cause exceptions
422
+
423
+ ## [1.3.7] 2013-01-06
424
+ - Add warnings when users do not provide a session secret
425
+ - Fix parsing performance for unquoted filenames
426
+ - Updated URI backports
427
+ - Fix URI backport version matching, and silence constant warnings
428
+ - Correct parameter parsing with empty values
429
+ - Correct rackup '-I' flag, to allow multiple uses
430
+ - Correct rackup pidfile handling
431
+ - Report rackup line numbers correctly
432
+ - Fix request loops caused by non-stale nonces with time limits
433
+ - Fix reloader on Windows
434
+ - Prevent infinite recursions from Response#to_ary
435
+ - Various middleware better conforms to the body close specification
436
+ - Updated language for the body close specification
437
+ - Additional notes regarding ECMA escape compatibility issues
438
+ - Fix the parsing of multiple ranges in range headers
439
+
440
+ ## [1.2.6] 2013-01-06
441
+ - Add warnings when users do not provide a session secret
442
+ - Fix parsing performance for unquoted filenames
443
+
444
+ ## [1.1.4] 2013-01-06
445
+ - Add warnings when users do not provide a session secret
446
+
447
+ ## [1.4.1] 2012-01-22
448
+ - Alter the keyspace limit calculations to reduce issues with nested params
449
+ - Add a workaround for multipart parsing where files contain unescaped "%"
450
+ - Added Rack::Response::Helpers#method_not_allowed? (code 405)
451
+ - Rack::File now returns 404 for illegal directory traversals
452
+ - Rack::File now returns 405 for illegal methods (non HEAD/GET)
453
+ - Rack::Cascade now catches 405 by default, as well as 404
454
+ - Cookies missing '--' no longer cause an exception to be raised
455
+ - Various style changes and documentation spelling errors
456
+ - Rack::BodyProxy always ensures to execute its block
457
+ - Additional test coverage around cookies and secrets
458
+ - Rack::Session::Cookie can now be supplied either secret or old_secret
459
+ - Tests are no longer dependent on set order
460
+ - Rack::Static no longer defaults to serving index files
461
+ - Rack.release was fixed
462
+
463
+ ## [1.4.0] 2011-12-28
464
+ - Ruby 1.8.6 support has officially been dropped. Not all tests pass.
465
+ - Raise sane error messages for broken config.ru
466
+ - Allow combining run and map in a config.ru
467
+ - Rack::ContentType will not set Content-Type for responses without a body
468
+ - Status code 205 does not send a response body
469
+ - Rack::Response::Helpers will not rely on instance variables
470
+ - Rack::Utils.build_query no longer outputs '=' for nil query values
471
+ - Various mime types added
472
+ - Rack::MockRequest now supports HEAD
473
+ - Rack::Directory now supports files that contain RFC3986 reserved chars
474
+ - Rack::File now only supports GET and HEAD requests
475
+ - Rack::Server#start now passes the block to Rack::Handler::<h>#run
476
+ - Rack::Static now supports an index option
477
+ - Added the Teapot status code
478
+ - rackup now defaults to Thin instead of Mongrel (if installed)
479
+ - Support added for HTTP_X_FORWARDED_SCHEME
480
+ - Numerous bug fixes, including many fixes for new and alternate rubies
481
+
482
+ ## [1.1.3] 2011-12-28
483
+ - Security fix. http://www.ocert.org/advisories/ocert-2011-003.html
484
+ Further information here: http://jruby.org/2011/12/27/jruby-1-6-5-1
485
+
486
+ ## [1.3.5] 2011-10-17
487
+ - Fix annoying warnings caused by the backport in 1.3.4
488
+
489
+ ## [1.3.4] 2011-10-01
490
+ - Backport security fix from 1.9.3, also fixes some roundtrip issues in URI
491
+ - Small documentation update
492
+ - Fix an issue where BodyProxy could cause an infinite recursion
493
+ - Add some supporting files for travis-ci
494
+
495
+ ## [1.2.4] 2011-09-16
496
+ - Fix a bug with MRI regex engine to prevent XSS by malformed unicode
497
+
498
+ ## [1.3.3] 2011-09-16
499
+ - Fix bug with broken query parameters in Rack::ShowExceptions
500
+ - Rack::Request#cookies no longer swallows exceptions on broken input
501
+ - Prevents XSS attacks enabled by bug in Ruby 1.8's regexp engine
502
+ - Rack::ConditionalGet handles broken If-Modified-Since helpers
503
+
504
+ ## [1.3.2] 2011-07-16
505
+ - Fix for Rails and rack-test, Rack::Utils#escape calls to_s
506
+
507
+ ## [1.3.1] 2011-07-13
508
+ - Fix 1.9.1 support
509
+ - Fix JRuby support
510
+ - Properly handle $KCODE in Rack::Utils.escape
511
+ - Make method_missing/respond_to behavior consistent for Rack::Lock,
512
+ Rack::Auth::Digest::Request and Rack::Multipart::UploadedFile
513
+ - Reenable passing rack.session to session middleware
514
+ - Rack::CommonLogger handles streaming responses correctly
515
+ - Rack::MockResponse calls close on the body object
516
+ - Fix a DOS vector from MRI stdlib backport
517
+
518
+ ## [1.2.3] 2011-05-22
519
+ - Pulled in relevant bug fixes from 1.3
520
+ - Fixed 1.8.6 support
521
+
522
+ ## [1.3.0] 2011-05-22
523
+ - Various performance optimizations
524
+ - Various multipart fixes
525
+ - Various multipart refactors
526
+ - Infinite loop fix for multipart
527
+ - Test coverage for Rack::Server returns
528
+ - Allow files with '..', but not path components that are '..'
529
+ - rackup accepts handler-specific options on the command line
530
+ - Request#params no longer merges POST into GET (but returns the same)
531
+ - Use URI.encode_www_form_component instead. Use core methods for escaping.
532
+ - Allow multi-line comments in the config file
533
+ - Bug L#94 reported by Nikolai Lugovoi, query parameter unescaping.
534
+ - Rack::Response now deletes Content-Length when appropriate
535
+ - Rack::Deflater now supports streaming
536
+ - Improved Rack::Handler loading and searching
537
+ - Support for the PATCH verb
538
+ - env['rack.session.options'] now contains session options
539
+ - Cookies respect renew
540
+ - Session middleware uses SecureRandom.hex
541
+
542
+ ## [1.2.2, 1.1.2] 2011-03-13
543
+ - Security fix in Rack::Auth::Digest::MD5: when authenticator
544
+ returned nil, permission was granted on empty password.
545
+
546
+ ## [1.2.1] 2010-06-15
547
+ - Make CGI handler rewindable
548
+ - Rename spec/ to test/ to not conflict with SPEC on lesser
549
+ operating systems
550
+
551
+ ## [1.2.0] 2010-06-13
552
+ - Removed Camping adapter: Camping 2.0 supports Rack as-is
553
+ - Removed parsing of quoted values
554
+ - Add Request.trace? and Request.options?
555
+ - Add mime-type for .webm and .htc
556
+ - Fix HTTP_X_FORWARDED_FOR
557
+ - Various multipart fixes
558
+ - Switch test suite to bacon
559
+
560
+ ## [1.1.0] 2010-01-03
561
+ - Moved Auth::OpenID to rack-contrib.
562
+ - SPEC change that relaxes Lint slightly to allow subclasses of the
563
+ required types
564
+ - SPEC change to document rack.input binary mode in greator detail
565
+ - SPEC define optional rack.logger specification
566
+ - File servers support X-Cascade header
567
+ - Imported Config middleware
568
+ - Imported ETag middleware
569
+ - Imported Runtime middleware
570
+ - Imported Sendfile middleware
571
+ - New Logger and NullLogger middlewares
572
+ - Added mime type for .ogv and .manifest.
573
+ - Don't squeeze PATH_INFO slashes
574
+ - Use Content-Type to determine POST params parsing
575
+ - Update Rack::Utils::HTTP_STATUS_CODES hash
576
+ - Add status code lookup utility
577
+ - Response should call #to_i on the status
578
+ - Add Request#user_agent
579
+ - Request#host knows about forwarded host
580
+ - Return an empty string for Request#host if HTTP_HOST and
581
+ SERVER_NAME are both missing
582
+ - Allow MockRequest to accept hash params
583
+ - Optimizations to HeaderHash
584
+ - Refactored rackup into Rack::Server
585
+ - Added Utils.build_nested_query to complement Utils.parse_nested_query
586
+ - Added Utils::Multipart.build_multipart to complement
587
+ Utils::Multipart.parse_multipart
588
+ - Extracted set and delete cookie helpers into Utils so they can be
589
+ used outside Response
590
+ - Extract parse_query and parse_multipart in Request so subclasses
591
+ can change their behavior
592
+ - Enforce binary encoding in RewindableInput
593
+ - Set correct external_encoding for handlers that don't use RewindableInput
594
+
595
+ ## [1.0.1] 2009-10-18
596
+ - Bump remainder of rack.versions.
597
+ - Support the pure Ruby FCGI implementation.
598
+ - Fix for form names containing "=": split first then unescape components
599
+ - Fixes the handling of the filename parameter with semicolons in names.
600
+ - Add anchor to nested params parsing regexp to prevent stack overflows
601
+ - Use more compatible gzip write api instead of "<<".
602
+ - Make sure that Reloader doesn't break when executed via ruby -e
603
+ - Make sure WEBrick respects the :Host option
604
+ - Many Ruby 1.9 fixes.
605
+
606
+ ## [1.0.0] 2009-04-25
607
+ - SPEC change: Rack::VERSION has been pushed to [1,0].
608
+ - SPEC change: header values must be Strings now, split on "\n".
609
+ - SPEC change: Content-Length can be missing, in this case chunked transfer
610
+ encoding is used.
611
+ - SPEC change: rack.input must be rewindable and support reading into
612
+ a buffer, wrap with Rack::RewindableInput if it isn't.
613
+ - SPEC change: rack.session is now specified.
614
+ - SPEC change: Bodies can now additionally respond to #to_path with
615
+ a filename to be served.
616
+ - NOTE: String bodies break in 1.9, use an Array consisting of a
617
+ single String instead.
618
+ - New middleware Rack::Lock.
619
+ - New middleware Rack::ContentType.
620
+ - Rack::Reloader has been rewritten.
621
+ - Major update to Rack::Auth::OpenID.
622
+ - Support for nested parameter parsing in Rack::Response.
623
+ - Support for redirects in Rack::Response.
624
+ - HttpOnly cookie support in Rack::Response.
625
+ - The Rakefile has been rewritten.
626
+ - Many bugfixes and small improvements.
627
+
628
+ ## [0.9.1] 2009-01-09
629
+ - Fix directory traversal exploits in Rack::File and Rack::Directory.
630
+
631
+ ## [0.9] 2009-01-06
632
+ - Rack is now managed by the Rack Core Team.
633
+ - Rack::Lint is stricter and follows the HTTP RFCs more closely.
634
+ - Added ConditionalGet middleware.
635
+ - Added ContentLength middleware.
636
+ - Added Deflater middleware.
637
+ - Added Head middleware.
638
+ - Added MethodOverride middleware.
639
+ - Rack::Mime now provides popular MIME-types and their extension.
640
+ - Mongrel Header now streams.
641
+ - Added Thin handler.
642
+ - Official support for swiftiplied Mongrel.
643
+ - Secure cookies.
644
+ - Made HeaderHash case-preserving.
645
+ - Many bugfixes and small improvements.
646
+
647
+ ## [0.4] 2008-08-21
648
+ - New middleware, Rack::Deflater, by Christoffer Sawicki.
649
+ - OpenID authentication now needs ruby-openid 2.
650
+ - New Memcache sessions, by blink.
651
+ - Explicit EventedMongrel handler, by Joshua Peek <josh@joshpeek.com>
652
+ - Rack::Reloader is not loaded in rackup development mode.
653
+ - rackup can daemonize with -D.
654
+ - Many bugfixes, especially for pool sessions, URLMap, thread safety
655
+ and tempfile handling.
656
+ - Improved tests.
657
+ - Rack moved to Git.
658
+
659
+ ## [0.3] 2008-02-26
660
+ - LiteSpeed handler, by Adrian Madrid.
661
+ - SCGI handler, by Jeremy Evans.
662
+ - Pool sessions, by blink.
663
+ - OpenID authentication, by blink.
664
+ - :Port and :File options for opening FastCGI sockets, by blink.
665
+ - Last-Modified HTTP header for Rack::File, by blink.
666
+ - Rack::Builder#use now accepts blocks, by Corey Jewett.
667
+ (See example/protectedlobster.ru)
668
+ - HTTP status 201 can contain a Content-Type and a body now.
669
+ - Many bugfixes, especially related to Cookie handling.
670
+
671
+ ## [0.2] 2007-05-16
672
+ - HTTP Basic authentication.
673
+ - Cookie Sessions.
674
+ - Static file handler.
675
+ - Improved Rack::Request.
676
+ - Improved Rack::Response.
677
+ - Added Rack::ShowStatus, for better default error messages.
678
+ - Bug fixes in the Camping adapter.
679
+ - Removed Rails adapter, was too alpha.
680
+
681
+ ## [0.1] 2007-03-03