rack 2.0.9.3 → 2.2.8

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 (191) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +740 -0
  3. data/CONTRIBUTING.md +136 -0
  4. data/{COPYING → MIT-LICENSE} +4 -2
  5. data/README.rdoc +151 -147
  6. data/Rakefile +37 -23
  7. data/{SPEC → SPEC.rdoc} +44 -15
  8. data/bin/rackup +1 -0
  9. data/example/lobster.ru +2 -0
  10. data/example/protectedlobster.rb +3 -1
  11. data/example/protectedlobster.ru +2 -0
  12. data/lib/rack/auth/abstract/handler.rb +3 -1
  13. data/lib/rack/auth/abstract/request.rb +1 -1
  14. data/lib/rack/auth/basic.rb +7 -4
  15. data/lib/rack/auth/digest/md5.rb +13 -11
  16. data/lib/rack/auth/digest/nonce.rb +6 -3
  17. data/lib/rack/auth/digest/params.rb +4 -2
  18. data/lib/rack/auth/digest/request.rb +5 -3
  19. data/lib/rack/body_proxy.rb +15 -14
  20. data/lib/rack/builder.rb +116 -23
  21. data/lib/rack/cascade.rb +28 -12
  22. data/lib/rack/chunked.rb +68 -20
  23. data/lib/rack/common_logger.rb +33 -25
  24. data/lib/rack/conditional_get.rb +20 -16
  25. data/lib/rack/config.rb +2 -0
  26. data/lib/rack/content_length.rb +8 -7
  27. data/lib/rack/content_type.rb +5 -4
  28. data/lib/rack/core_ext/regexp.rb +14 -0
  29. data/lib/rack/deflater.rb +59 -34
  30. data/lib/rack/directory.rb +84 -64
  31. data/lib/rack/etag.rb +7 -4
  32. data/lib/rack/events.rb +19 -20
  33. data/lib/rack/file.rb +4 -173
  34. data/lib/rack/files.rb +218 -0
  35. data/lib/rack/handler/cgi.rb +2 -3
  36. data/lib/rack/handler/fastcgi.rb +4 -4
  37. data/lib/rack/handler/lsws.rb +3 -3
  38. data/lib/rack/handler/scgi.rb +9 -8
  39. data/lib/rack/handler/thin.rb +3 -3
  40. data/lib/rack/handler/webrick.rb +15 -6
  41. data/lib/rack/handler.rb +7 -2
  42. data/lib/rack/head.rb +1 -1
  43. data/lib/rack/lint.rb +219 -184
  44. data/lib/rack/lobster.rb +10 -10
  45. data/lib/rack/lock.rb +2 -1
  46. data/lib/rack/logger.rb +2 -0
  47. data/lib/rack/media_type.rb +10 -5
  48. data/lib/rack/method_override.rb +5 -3
  49. data/lib/rack/mime.rb +9 -1
  50. data/lib/rack/mock.rb +97 -20
  51. data/lib/rack/multipart/generator.rb +17 -13
  52. data/lib/rack/multipart/parser.rb +55 -56
  53. data/lib/rack/multipart/uploaded_file.rb +15 -7
  54. data/lib/rack/multipart.rb +4 -2
  55. data/lib/rack/null_logger.rb +2 -0
  56. data/lib/rack/query_parser.rb +59 -30
  57. data/lib/rack/recursive.rb +7 -5
  58. data/lib/rack/reloader.rb +8 -4
  59. data/lib/rack/request.rb +222 -63
  60. data/lib/rack/response.rb +127 -44
  61. data/lib/rack/rewindable_input.rb +4 -3
  62. data/lib/rack/runtime.rb +6 -4
  63. data/lib/rack/sendfile.rb +13 -9
  64. data/lib/rack/server.rb +95 -24
  65. data/lib/rack/session/abstract/id.rb +34 -21
  66. data/lib/rack/session/cookie.rb +12 -12
  67. data/lib/rack/session/memcache.rb +4 -93
  68. data/lib/rack/session/pool.rb +5 -3
  69. data/lib/rack/show_exceptions.rb +21 -17
  70. data/lib/rack/show_status.rb +9 -9
  71. data/lib/rack/static.rb +23 -11
  72. data/lib/rack/tempfile_reaper.rb +1 -1
  73. data/lib/rack/urlmap.rb +13 -7
  74. data/lib/rack/utils.rb +105 -111
  75. data/lib/rack/version.rb +29 -0
  76. data/lib/rack.rb +67 -73
  77. data/rack.gemspec +40 -28
  78. metadata +36 -179
  79. data/HISTORY.md +0 -520
  80. data/test/builder/an_underscore_app.rb +0 -5
  81. data/test/builder/anything.rb +0 -5
  82. data/test/builder/comment.ru +0 -4
  83. data/test/builder/end.ru +0 -5
  84. data/test/builder/line.ru +0 -1
  85. data/test/builder/options.ru +0 -2
  86. data/test/cgi/assets/folder/test.js +0 -1
  87. data/test/cgi/assets/fonts/font.eot +0 -1
  88. data/test/cgi/assets/images/image.png +0 -1
  89. data/test/cgi/assets/index.html +0 -1
  90. data/test/cgi/assets/javascripts/app.js +0 -1
  91. data/test/cgi/assets/stylesheets/app.css +0 -1
  92. data/test/cgi/lighttpd.conf +0 -26
  93. data/test/cgi/rackup_stub.rb +0 -6
  94. data/test/cgi/sample_rackup.ru +0 -5
  95. data/test/cgi/test +0 -9
  96. data/test/cgi/test+directory/test+file +0 -1
  97. data/test/cgi/test.fcgi +0 -9
  98. data/test/cgi/test.gz +0 -0
  99. data/test/cgi/test.ru +0 -5
  100. data/test/gemloader.rb +0 -10
  101. data/test/helper.rb +0 -34
  102. data/test/multipart/bad_robots +0 -259
  103. data/test/multipart/binary +0 -0
  104. data/test/multipart/content_type_and_no_filename +0 -6
  105. data/test/multipart/empty +0 -10
  106. data/test/multipart/fail_16384_nofile +0 -814
  107. data/test/multipart/file1.txt +0 -1
  108. data/test/multipart/filename_and_modification_param +0 -7
  109. data/test/multipart/filename_and_no_name +0 -6
  110. data/test/multipart/filename_with_encoded_words +0 -7
  111. data/test/multipart/filename_with_escaped_quotes +0 -6
  112. data/test/multipart/filename_with_escaped_quotes_and_modification_param +0 -7
  113. data/test/multipart/filename_with_null_byte +0 -7
  114. data/test/multipart/filename_with_percent_escaped_quotes +0 -6
  115. data/test/multipart/filename_with_single_quote +0 -7
  116. data/test/multipart/filename_with_unescaped_percentages +0 -6
  117. data/test/multipart/filename_with_unescaped_percentages2 +0 -6
  118. data/test/multipart/filename_with_unescaped_percentages3 +0 -6
  119. data/test/multipart/filename_with_unescaped_quotes +0 -6
  120. data/test/multipart/ie +0 -6
  121. data/test/multipart/invalid_character +0 -6
  122. data/test/multipart/mixed_files +0 -21
  123. data/test/multipart/nested +0 -10
  124. data/test/multipart/none +0 -9
  125. data/test/multipart/quoted +0 -15
  126. data/test/multipart/rack-logo.png +0 -0
  127. data/test/multipart/semicolon +0 -6
  128. data/test/multipart/text +0 -15
  129. data/test/multipart/three_files_three_fields +0 -31
  130. data/test/multipart/unity3d_wwwform +0 -11
  131. data/test/multipart/webkit +0 -32
  132. data/test/rackup/config.ru +0 -31
  133. data/test/registering_handler/rack/handler/registering_myself.rb +0 -8
  134. data/test/spec_auth_basic.rb +0 -89
  135. data/test/spec_auth_digest.rb +0 -260
  136. data/test/spec_body_proxy.rb +0 -85
  137. data/test/spec_builder.rb +0 -233
  138. data/test/spec_cascade.rb +0 -63
  139. data/test/spec_cgi.rb +0 -84
  140. data/test/spec_chunked.rb +0 -103
  141. data/test/spec_common_logger.rb +0 -107
  142. data/test/spec_conditional_get.rb +0 -103
  143. data/test/spec_config.rb +0 -23
  144. data/test/spec_content_length.rb +0 -86
  145. data/test/spec_content_type.rb +0 -46
  146. data/test/spec_deflater.rb +0 -375
  147. data/test/spec_directory.rb +0 -148
  148. data/test/spec_etag.rb +0 -108
  149. data/test/spec_events.rb +0 -133
  150. data/test/spec_fastcgi.rb +0 -85
  151. data/test/spec_file.rb +0 -264
  152. data/test/spec_handler.rb +0 -57
  153. data/test/spec_head.rb +0 -46
  154. data/test/spec_lint.rb +0 -520
  155. data/test/spec_lobster.rb +0 -59
  156. data/test/spec_lock.rb +0 -204
  157. data/test/spec_logger.rb +0 -24
  158. data/test/spec_media_type.rb +0 -42
  159. data/test/spec_method_override.rb +0 -110
  160. data/test/spec_mime.rb +0 -51
  161. data/test/spec_mock.rb +0 -359
  162. data/test/spec_multipart.rb +0 -721
  163. data/test/spec_null_logger.rb +0 -21
  164. data/test/spec_recursive.rb +0 -75
  165. data/test/spec_request.rb +0 -1423
  166. data/test/spec_response.rb +0 -528
  167. data/test/spec_rewindable_input.rb +0 -128
  168. data/test/spec_runtime.rb +0 -50
  169. data/test/spec_sendfile.rb +0 -125
  170. data/test/spec_server.rb +0 -193
  171. data/test/spec_session_abstract_id.rb +0 -31
  172. data/test/spec_session_abstract_session_hash.rb +0 -45
  173. data/test/spec_session_cookie.rb +0 -442
  174. data/test/spec_session_memcache.rb +0 -357
  175. data/test/spec_session_persisted_secure_secure_session_hash.rb +0 -73
  176. data/test/spec_session_pool.rb +0 -247
  177. data/test/spec_show_exceptions.rb +0 -93
  178. data/test/spec_show_status.rb +0 -104
  179. data/test/spec_static.rb +0 -184
  180. data/test/spec_tempfile_reaper.rb +0 -64
  181. data/test/spec_thin.rb +0 -96
  182. data/test/spec_urlmap.rb +0 -237
  183. data/test/spec_utils.rb +0 -742
  184. data/test/spec_version.rb +0 -11
  185. data/test/spec_webrick.rb +0 -206
  186. data/test/static/another/index.html +0 -1
  187. data/test/static/foo.html +0 -1
  188. data/test/static/index.html +0 -1
  189. data/test/testrequest.rb +0 -78
  190. data/test/unregistered_handler/rack/handler/unregistered.rb +0 -7
  191. data/test/unregistered_handler/rack/handler/unregistered_long_one.rb +0 -7
data/CHANGELOG.md ADDED
@@ -0,0 +1,740 @@
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.7] - 2023-03-13
6
+
7
+ - Correct the year number in the changelog ([#2015](https://github.com/rack/rack/pull/2015), [@kimulab](https://github.com/kimulab))
8
+ - Support underscore in host names for Rack 2.2 (Fixes [#2070](https://github.com/rack/rack/issues/2070)) ([#2015](https://github.com/rack/rack/pull/2071), [@jeremyevans](https://github.com/jeremyevans))
9
+
10
+ ## [2.2.6.4] - 2023-03-13
11
+
12
+ - [CVE-2023-27539] Avoid ReDoS in header parsing
13
+
14
+ ## [2.2.6.3] - 2023-03-02
15
+
16
+ - [CVE-2023-27530] Introduce multipart_total_part_limit to limit total parts
17
+
18
+ ## [2.2.6.2] - 2023-01-17
19
+
20
+ - [CVE-2022-44570] Fix ReDoS in Rack::Utils.get_byte_ranges
21
+
22
+ ## [2.2.6.1] - 2023-01-17
23
+
24
+ - [CVE-2022-44571] Fix ReDoS vulnerability in multipart parser
25
+ - [CVE-2022-44572] Forbid control characters in attributes (also ReDoS)
26
+
27
+ ## [2.2.6] - 2023-01-17
28
+
29
+ - Extend `Rack::MethodOverride` to handle `QueryParser::ParamsTooDeepError` error. ([#2011](https://github.com/rack/rack/pull/2011), [@byroot](https://github.com/byroot))
30
+
31
+ ## [2.2.5] - 2022-12-27
32
+
33
+ ### Fixed
34
+
35
+ - `Rack::URLMap` uses non-deprecated form of `Regexp.new`. ([#1998](https://github.com/rack/rack/pull/1998), [@weizheheng](https://github.com/weizheheng))
36
+
37
+ ## [2.2.4] - 2022-06-30
38
+
39
+ - Better support for lower case headers in `Rack::ETag` middleware. ([#1919](https://github.com/rack/rack/pull/1919), [@ioquatix](https://github.com/ioquatix))
40
+ - Use custom exception on params too deep error. ([#1838](https://github.com/rack/rack/pull/1838), [@simi](https://github.com/simi))
41
+
42
+ ## [2.2.3.1] - 2022-05-27
43
+
44
+ ### Security
45
+
46
+ - [CVE-2022-30123] Fix shell escaping issue in Common Logger
47
+ - [CVE-2022-30122] Restrict parsing of broken MIME attachments
48
+
49
+ ## [2.2.3] - 2020-02-11
50
+
51
+ ### Security
52
+
53
+ - [CVE-2020-8184] Only decode cookie values
54
+
55
+ ## [2.2.2] - 2020-02-11
56
+
57
+ ### Fixed
58
+
59
+ - Fix incorrect `Rack::Request#host` value. ([#1591](https://github.com/rack/rack/pull/1591), [@ioquatix](https://github.com/ioquatix))
60
+ - Revert `Rack::Handler::Thin` implementation. ([#1583](https://github.com/rack/rack/pull/1583), [@jeremyevans](https://github.com/jeremyevans))
61
+ - Double assignment is still needed to prevent an "unused variable" warning. ([#1589](https://github.com/rack/rack/pull/1589), [@kamipo](https://github.com/kamipo))
62
+ - Fix to handle same_site option for session pool. ([#1587](https://github.com/rack/rack/pull/1587), [@kamipo](https://github.com/kamipo))
63
+
64
+ ## [2.2.1] - 2020-02-09
65
+
66
+ ### Fixed
67
+
68
+ - Rework `Rack::Request#ip` to handle empty `forwarded_for`. ([#1577](https://github.com/rack/rack/pull/1577), [@ioquatix](https://github.com/ioquatix))
69
+
70
+ ## [2.2.0] - 2020-02-08
71
+
72
+ ### SPEC Changes
73
+
74
+ - `rack.session` request environment entry must respond to `to_hash` and return unfrozen Hash. ([@jeremyevans](https://github.com/jeremyevans))
75
+ - Request environment cannot be frozen. ([@jeremyevans](https://github.com/jeremyevans))
76
+ - CGI values in the request environment with non-ASCII characters must use ASCII-8BIT encoding. ([@jeremyevans](https://github.com/jeremyevans))
77
+ - 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))
78
+
79
+ ### Added
80
+
81
+ - `rackup` supports multiple `-r` options and will require all arguments. ([@jeremyevans](https://github.com/jeremyevans))
82
+ - `Server` supports an array of paths to require for the `:require` option. ([@khotta](https://github.com/khotta))
83
+ - `Files` supports multipart range requests. ([@fatkodima](https://github.com/fatkodima))
84
+ - `Multipart::UploadedFile` supports an IO-like object instead of using the filesystem, using `:filename` and `:io` options. ([@jeremyevans](https://github.com/jeremyevans))
85
+ - `Multipart::UploadedFile` supports keyword arguments `:path`, `:content_type`, and `:binary` in addition to positional arguments. ([@jeremyevans](https://github.com/jeremyevans))
86
+ - `Static` supports a `:cascade` option for calling the app if there is no matching file. ([@jeremyevans](https://github.com/jeremyevans))
87
+ - `Session::Abstract::SessionHash#dig`. ([@jeremyevans](https://github.com/jeremyevans))
88
+ - `Response.[]` and `MockResponse.[]` for creating instances using status, headers, and body. ([@ioquatix](https://github.com/ioquatix))
89
+ - Convenient cache and content type methods for `Rack::Response`. ([#1555](https://github.com/rack/rack/pull/1555), [@ioquatix](https://github.com/ioquatix))
90
+
91
+ ### Changed
92
+
93
+ - `Request#params` no longer rescues EOFError. ([@jeremyevans](https://github.com/jeremyevans))
94
+ - `Directory` uses a streaming approach, significantly improving time to first byte for large directories. ([@jeremyevans](https://github.com/jeremyevans))
95
+ - `Directory` no longer includes a Parent directory link in the root directory index. ([@jeremyevans](https://github.com/jeremyevans))
96
+ - `QueryParser#parse_nested_query` uses original backtrace when reraising exception with new class. ([@jeremyevans](https://github.com/jeremyevans))
97
+ - `ConditionalGet` follows RFC 7232 precedence if both If-None-Match and If-Modified-Since headers are provided. ([@jeremyevans](https://github.com/jeremyevans))
98
+ - `.ru` files supports the `frozen-string-literal` magic comment. ([@eregon](https://github.com/eregon))
99
+ - 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))
100
+ - `Etag` will continue sending ETag even if the response should not be cached. ([@henm](https://github.com/henm))
101
+ - `Request#host_with_port` no longer includes a colon for a missing or empty port. ([@AlexWayfer](https://github.com/AlexWayfer))
102
+ - All handlers uses keywords arguments instead of an options hash argument. ([@ioquatix](https://github.com/ioquatix))
103
+ - `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))
104
+ - `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))
105
+ - `Request#ssl?` is true for the `wss` scheme (secure websockets). ([@jeremyevans](https://github.com/jeremyevans))
106
+ - `Rack::HeaderHash` is memoized by default. ([#1549](https://github.com/rack/rack/pull/1549), [@ioquatix](https://github.com/ioquatix))
107
+ - `Rack::Directory` allow directory traversal inside root directory. ([#1417](https://github.com/rack/rack/pull/1417), [@ThomasSevestre](https://github.com/ThomasSevestre))
108
+ - Sort encodings by server preference. ([#1184](https://github.com/rack/rack/pull/1184), [@ioquatix](https://github.com/ioquatix), [@wjordan](https://github.com/wjordan))
109
+ - 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))
110
+ - `Rack::Builder` parsing options on first `#\` line is deprecated. ([#1574](https://github.com/rack/rack/pull/1574), [@ioquatix](https://github.com/ioquatix))
111
+
112
+ ### Removed
113
+
114
+ - `Directory#path` as it was not used and always returned nil. ([@jeremyevans](https://github.com/jeremyevans))
115
+ - `BodyProxy#each` as it was only needed to work around a bug in Ruby <1.9.3. ([@jeremyevans](https://github.com/jeremyevans))
116
+ - `URLMap::INFINITY` and `URLMap::NEGATIVE_INFINITY`, in favor of `Float::INFINITY`. ([@ch1c0t](https://github.com/ch1c0t))
117
+ - Deprecation of `Rack::File`. It will be deprecated again in rack 2.2 or 3.0. ([@rafaelfranca](https://github.com/rafaelfranca))
118
+ - Support for Ruby 2.2 as it is well past EOL. ([@ioquatix](https://github.com/ioquatix))
119
+ - Remove `Rack::Files#response_body` as the implementation was broken. ([#1153](https://github.com/rack/rack/pull/1153), [@ioquatix](https://github.com/ioquatix))
120
+ - Remove `SERVER_ADDR` which was never part of the original SPEC. ([#1573](https://github.com/rack/rack/pull/1573), [@ioquatix](https://github.com/ioquatix))
121
+
122
+ ### Fixed
123
+
124
+ - `Directory` correctly handles root paths containing glob metacharacters. ([@jeremyevans](https://github.com/jeremyevans))
125
+ - `Cascade` uses a new response object for each call if initialized with no apps. ([@jeremyevans](https://github.com/jeremyevans))
126
+ - `BodyProxy` correctly delegates keyword arguments to the body object on Ruby 2.7+. ([@jeremyevans](https://github.com/jeremyevans))
127
+ - `BodyProxy#method` correctly handles methods delegated to the body object. ([@jeremyevans](https://github.com/jeremyevans))
128
+ - `Request#host` and `Request#host_with_port` handle IPv6 addresses correctly. ([@AlexWayfer](https://github.com/AlexWayfer))
129
+ - `Lint` checks when response hijacking that `rack.hijack` is called with a valid object. ([@jeremyevans](https://github.com/jeremyevans))
130
+ - `Response#write` correctly updates `Content-Length` if initialized with a body. ([@jeremyevans](https://github.com/jeremyevans))
131
+ - `CommonLogger` includes `SCRIPT_NAME` when logging. ([@Erol](https://github.com/Erol))
132
+ - `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))
133
+ - `Directory` correctly escapes paths in links. ([@yous](https://github.com/yous))
134
+ - `Request#delete_cookie` and related `Utils` methods handle `:domain` and `:path` options in same call. ([@jeremyevans](https://github.com/jeremyevans))
135
+ - `Request#delete_cookie` and related `Utils` methods do an exact match on `:domain` and `:path` options. ([@jeremyevans](https://github.com/jeremyevans))
136
+ - `Static` no longer adds headers when a gzipped file request has a 304 response. ([@chooh](https://github.com/chooh))
137
+ - `ContentLength` sets `Content-Length` response header even for bodies not responding to `to_ary`. ([@jeremyevans](https://github.com/jeremyevans))
138
+ - Thin handler supports options passed directly to `Thin::Controllers::Controller`. ([@jeremyevans](https://github.com/jeremyevans))
139
+ - WEBrick handler no longer ignores `:BindAddress` option. ([@jeremyevans](https://github.com/jeremyevans))
140
+ - `ShowExceptions` handles invalid POST data. ([@jeremyevans](https://github.com/jeremyevans))
141
+ - Basic authentication requires a password, even if the password is empty. ([@jeremyevans](https://github.com/jeremyevans))
142
+ - `Lint` checks response is array with 3 elements, per SPEC. ([@jeremyevans](https://github.com/jeremyevans))
143
+ - Support for using `:SSLEnable` option when using WEBrick handler. (Gregor Melhorn)
144
+ - Close response body after buffering it when buffering. ([@ioquatix](https://github.com/ioquatix))
145
+ - Only accept `;` as delimiter when parsing cookies. ([@mrageh](https://github.com/mrageh))
146
+ - `Utils::HeaderHash#clear` clears the name mapping as well. ([@raxoft](https://github.com/raxoft))
147
+ - Support for passing `nil` `Rack::Files.new`, which notably fixes Rails' current `ActiveStorage::FileServer` implementation. ([@ioquatix](https://github.com/ioquatix))
148
+
149
+ ### Documentation
150
+
151
+ - CHANGELOG updates. ([@aupajo](https://github.com/aupajo))
152
+ - Added [CONTRIBUTING](CONTRIBUTING.md). ([@dblock](https://github.com/dblock))
153
+
154
+ ## [2.1.2] - 2020-01-27
155
+
156
+ - Fix multipart parser for some files to prevent denial of service ([@aiomaster](https://github.com/aiomaster))
157
+ - Fix `Rack::Builder#use` with keyword arguments ([@kamipo](https://github.com/kamipo))
158
+ - Skip deflating in Rack::Deflater if Content-Length is 0 ([@jeremyevans](https://github.com/jeremyevans))
159
+ - Remove `SessionHash#transform_keys`, no longer needed ([@pavel](https://github.com/pavel))
160
+ - Add to_hash to wrap Hash and Session classes ([@oleh-demyanyuk](https://github.com/oleh-demyanyuk))
161
+ - Handle case where session id key is requested but missing ([@jeremyevans](https://github.com/jeremyevans))
162
+
163
+ ## [2.1.1] - 2020-01-12
164
+
165
+ - Remove `Rack::Chunked` from `Rack::Server` default middleware. ([#1475](https://github.com/rack/rack/pull/1475), [@ioquatix](https://github.com/ioquatix))
166
+ - Restore support for code relying on `SessionId#to_s`. ([@jeremyevans](https://github.com/jeremyevans))
167
+
168
+ ## [2.1.0] - 2020-01-10
169
+
170
+ ### Added
171
+
172
+ - Add support for `SameSite=None` cookie value. ([@hennikul](https://github.com/hennikul))
173
+ - Add trailer headers. ([@eileencodes](https://github.com/eileencodes))
174
+ - Add MIME Types for video streaming. ([@styd](https://github.com/styd))
175
+ - Add MIME Type for WASM. ([@buildrtech](https://github.com/buildrtech))
176
+ - Add `Early Hints(103)` to status codes. ([@egtra](https://github.com/egtra))
177
+ - Add `Too Early(425)` to status codes. ([@y-yagi]((https://github.com/y-yagi)))
178
+ - Add `Bandwidth Limit Exceeded(509)` to status codes. ([@CJKinni](https://github.com/CJKinni))
179
+ - Add method for custom `ip_filter`. ([@svcastaneda](https://github.com/svcastaneda))
180
+ - Add boot-time profiling capabilities to `rackup`. ([@tenderlove](https://github.com/tenderlove))
181
+ - Add multi mapping support for `X-Accel-Mappings` header. ([@yoshuki](https://github.com/yoshuki))
182
+ - Add `sync: false` option to `Rack::Deflater`. (Eric Wong)
183
+ - Add `Builder#freeze_app` to freeze application and all middleware instances. ([@jeremyevans](https://github.com/jeremyevans))
184
+ - Add API to extract cookies from `Rack::MockResponse`. ([@petercline](https://github.com/petercline))
185
+
186
+ ### Changed
187
+
188
+ - Don't propagate nil values from middleware. ([@ioquatix](https://github.com/ioquatix))
189
+ - Lazily initialize the response body and only buffer it if required. ([@ioquatix](https://github.com/ioquatix))
190
+ - Fix deflater zlib buffer errors on empty body part. ([@felixbuenemann](https://github.com/felixbuenemann))
191
+ - Set `X-Accel-Redirect` to percent-encoded path. ([@diskkid](https://github.com/diskkid))
192
+ - Remove unnecessary buffer growing when parsing multipart. ([@tainoe](https://github.com/tainoe))
193
+ - Expand the root path in `Rack::Static` upon initialization. ([@rosenfeld](https://github.com/rosenfeld))
194
+ - Make `ShowExceptions` work with binary data. ([@axyjo](https://github.com/axyjo))
195
+ - Use buffer string when parsing multipart requests. ([@janko-m](https://github.com/janko-m))
196
+ - Support optional UTF-8 Byte Order Mark (BOM) in config.ru. ([@mikegee](https://github.com/mikegee))
197
+ - Handle `X-Forwarded-For` with optional port. ([@dpritchett](https://github.com/dpritchett))
198
+ - Use `Time#httpdate` format for Expires, as proposed by RFC 7231. ([@nanaya](https://github.com/nanaya))
199
+ - Make `Utils.status_code` raise an error when the status symbol is invalid instead of `500`. ([@adambutler](https://github.com/adambutler))
200
+ - Rename `Request::SCHEME_WHITELIST` to `Request::ALLOWED_SCHEMES`.
201
+ - Make `Multipart::Parser.get_filename` accept files with `+` in their name. ([@lucaskanashiro](https://github.com/lucaskanashiro))
202
+ - Add Falcon to the default handler fallbacks. ([@ioquatix](https://github.com/ioquatix))
203
+ - Update codebase to avoid string mutations in preparation for `frozen_string_literals`. ([@pat](https://github.com/pat))
204
+ - Change `MockRequest#env_for` to rely on the input optionally responding to `#size` instead of `#length`. ([@janko](https://github.com/janko))
205
+ - Rename `Rack::File` -> `Rack::Files` and add deprecation notice. ([@postmodern](https://github.com/postmodern)).
206
+ - Prefer Base64 “strict encoding” for Base64 cookies. ([@ioquatix](https://github.com/ioquatix))
207
+
208
+ ### Removed
209
+
210
+ - Remove `to_ary` from Response ([@tenderlove](https://github.com/tenderlove))
211
+ - Deprecate `Rack::Session::Memcache` in favor of `Rack::Session::Dalli` from dalli gem ([@fatkodima](https://github.com/fatkodima))
212
+
213
+ ### Fixed
214
+
215
+ - Eliminate warnings for Ruby 2.7. ([@osamtimizer](https://github.com/osamtimizer]))
216
+
217
+ ### Documentation
218
+
219
+ - Update broken example in `Session::Abstract::ID` documentation. ([tonytonyjan](https://github.com/tonytonyjan))
220
+ - Add Padrino to the list of frameworks implementing Rack. ([@wikimatze](https://github.com/wikimatze))
221
+ - Remove Mongrel from the suggested server options in the help output. ([@tricknotes](https://github.com/tricknotes))
222
+ - Replace `HISTORY.md` and `NEWS.md` with `CHANGELOG.md`. ([@twitnithegirl](https://github.com/twitnithegirl))
223
+ - CHANGELOG updates. ([@drenmi](https://github.com/Drenmi), [@p8](https://github.com/p8))
224
+
225
+ ## [2.0.8] - 2019-12-08
226
+
227
+ ### Security
228
+
229
+ - [[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))
230
+
231
+ ## [1.6.12] - 2019-12-08
232
+
233
+ ### Security
234
+
235
+ - [[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))
236
+
237
+ ## [2.0.7] - 2019-04-02
238
+
239
+ ### Fixed
240
+
241
+ - Remove calls to `#eof?` on Rack input in `Multipart::Parser`, as this breaks the specification. ([@matthewd](https://github.com/matthewd))
242
+ - Preserve forwarded IP addresses for trusted proxy chains. ([@SamSaffron](https://github.com/SamSaffron))
243
+
244
+ ## [2.0.6] - 2018-11-05
245
+
246
+ ### Fixed
247
+
248
+ - [[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))
249
+ - Fix a call to a non-existing method `#accepts_html` in the `ShowExceptions` middleware. ([@tomelm](https://github.com/tomelm))
250
+ - [[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))
251
+
252
+ ## [2.0.5] - 2018-04-23
253
+
254
+ ### Fixed
255
+
256
+ - Record errors originating from invalid UTF8 in `MethodOverride` middleware instead of breaking. ([@mclark](https://github.com/mclark))
257
+
258
+ ## [2.0.4] - 2018-01-31
259
+
260
+ ### Changed
261
+
262
+ - Ensure the `Lock` middleware passes the original `env` object. ([@lugray](https://github.com/lugray))
263
+ - Improve performance of `Multipart::Parser` when uploading large files. ([@tompng](https://github.com/tompng))
264
+ - Increase buffer size in `Multipart::Parser` for better performance. ([@jkowens](https://github.com/jkowens))
265
+ - Reduce memory usage of `Multipart::Parser` when uploading large files. ([@tompng](https://github.com/tompng))
266
+ - Replace ConcurrentRuby dependency with native `Queue`. ([@devmchakan](https://github.com/devmchakan))
267
+
268
+ ### Fixed
269
+
270
+ - Require the correct digest algorithm in the `ETag` middleware. ([@matthewd](https://github.com/matthewd))
271
+
272
+ ### Documentation
273
+
274
+ - Update homepage links to use SSL. ([@hugoabonizio](https://github.com/hugoabonizio))
275
+
276
+ ## [2.0.3] - 2017-05-15
277
+
278
+ ### Changed
279
+
280
+ - Ensure `env` values are ASCII 8-bit encoded. ([@eileencodes](https://github.com/eileencodes))
281
+
282
+ ### Fixed
283
+
284
+ - Prevent exceptions when a class with mixins inherits from `Session::Abstract::ID`. ([@jnraine](https://github.com/jnraine))
285
+
286
+ ## [2.0.2] - 2017-05-08
287
+
288
+ ### Added
289
+
290
+ - Allow `Session::Abstract::SessionHash#fetch` to accept a block with a default value. ([@yannvanhalewyn](https://github.com/yannvanhalewyn))
291
+ - Add `Builder#freeze_app` to freeze application and all middleware. ([@jeremyevans](https://github.com/jeremyevans))
292
+
293
+ ### Changed
294
+
295
+ - Freeze default session options to avoid accidental mutation. ([@kirs](https://github.com/kirs))
296
+ - Detect partial hijack without hash headers. ([@devmchakan](https://github.com/devmchakan))
297
+ - Update tests to use MiniTest 6 matchers. ([@tonytonyjan](https://github.com/tonytonyjan))
298
+ - Allow 205 Reset Content responses to set a Content-Length, as RFC 7231 proposes setting this to 0. ([@devmchakan](https://github.com/devmchakan))
299
+
300
+ ### Fixed
301
+
302
+ - Handle `NULL` bytes in multipart filenames. ([@casperisfine](https://github.com/casperisfine))
303
+ - Remove warnings due to miscapitalized global. ([@ioquatix](https://github.com/ioquatix))
304
+ - Prevent exceptions caused by a race condition on multi-threaded servers. ([@sophiedeziel](https://github.com/sophiedeziel))
305
+ - Add RDoc as an explicit depencency for `doc` group. ([@tonytonyjan](https://github.com/tonytonyjan))
306
+ - Record errors originating from `Multipart::Parser` in the `MethodOverride` middleware instead of letting them bubble up. ([@carlzulauf](https://github.com/carlzulauf))
307
+ - Remove remaining use of removed `Utils#bytesize` method from the `File` middleware. ([@brauliomartinezlm](https://github.com/brauliomartinezlm))
308
+
309
+ ### Removed
310
+
311
+ - Remove `deflate` encoding support to reduce caching overhead. ([@devmchakan](https://github.com/devmchakan))
312
+
313
+ ### Documentation
314
+
315
+ - Update broken example in `Deflater` documentation. ([@mwpastore](https://github.com/mwpastore))
316
+
317
+ ## [2.0.1] - 2016-06-30
318
+
319
+ ### Changed
320
+
321
+ - Remove JSON as an explicit dependency. ([@mperham](https://github.com/mperham))
322
+
323
+
324
+ # History/News Archive
325
+ Items below this line are from the previously maintained HISTORY.md and NEWS.md files.
326
+
327
+ ## [2.0.0.rc1] 2016-05-06
328
+ - Rack::Session::Abstract::ID is deprecated. Please change to use Rack::Session::Abstract::Persisted
329
+
330
+ ## [2.0.0.alpha] 2015-12-04
331
+ - First-party "SameSite" cookies. Browsers omit SameSite cookies from third-party requests, closing the door on many CSRF attacks.
332
+ - 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
333
+ - Based on version 7 of the Same-site Cookies internet draft:
334
+ https://tools.ietf.org/html/draft-west-first-party-cookies-07
335
+ - Thanks to Ben Toews (@mastahyeti) and Bob Long (@bobjflong) for updating to drafts 5 and 7.
336
+ - 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.
337
+ - Add `Rack::Request#authority` to calculate the authority under which the response is being made (this will be handy for h2 pushes).
338
+ - Add `Rack::Response::Helpers#cache_control` and `cache_control=`. Use this for setting cache control headers on your response objects.
339
+ - Add `Rack::Response::Helpers#etag` and `etag=`. Use this for setting etag values on the response.
340
+ - 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.
341
+ - Add `Rack::Request#add_header` to match.
342
+ - `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.
343
+ - 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
344
+ - 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).
345
+ - 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
346
+ - Tempfiles are automatically closed in the case that there were too
347
+ many posted.
348
+ - Added methods for manipulating response headers that don't assume
349
+ they're stored as a Hash. Response-like classes may include the
350
+ Rack::Response::Helpers module if they define these methods:
351
+ - Rack::Response#has_header?
352
+ - Rack::Response#get_header
353
+ - Rack::Response#set_header
354
+ - Rack::Response#delete_header
355
+ - 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.
356
+ - 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).
357
+ - Add `Rack::Request#initialize_copy` so that the env is duped when the request gets duped.
358
+ - Added methods for manipulating request specific data. This includes
359
+ data set as CGI parameters, and just any arbitrary data the user wants
360
+ to associate with a particular request. New methods:
361
+ - Rack::Request#has_header?
362
+ - Rack::Request#get_header
363
+ - Rack::Request#fetch_header
364
+ - Rack::Request#each_header
365
+ - Rack::Request#set_header
366
+ - Rack::Request#delete_header
367
+ - lib/rack/utils.rb: add a method for constructing "delete" cookie
368
+ headers. This allows us to construct cookie headers without depending
369
+ on the side effects of mutating a hash.
370
+ - Prevent extremely deep parameters from being parsed. CVE-2015-3225
371
+
372
+ ## [1.6.1] 2015-05-06
373
+ - Fix CVE-2014-9490, denial of service attack in OkJson
374
+ - Use a monotonic time for Rack::Runtime, if available
375
+ - RACK_MULTIPART_LIMIT changed to RACK_MULTIPART_PART_LIMIT (RACK_MULTIPART_LIMIT is deprecated and will be removed in 1.7.0)
376
+
377
+ ## [1.5.3] 2015-05-06
378
+ - Fix CVE-2014-9490, denial of service attack in OkJson
379
+ - Backport bug fixes to 1.5 series
380
+
381
+ ## [1.6.0] 2014-01-18
382
+ - Response#unauthorized? helper
383
+ - Deflater now accepts an options hash to control compression on a per-request level
384
+ - Builder#warmup method for app preloading
385
+ - Request#accept_language method to extract HTTP_ACCEPT_LANGUAGE
386
+ - Add quiet mode of rack server, rackup --quiet
387
+ - Update HTTP Status Codes to RFC 7231
388
+ - Less strict header name validation according to RFC 2616
389
+ - SPEC updated to specify headers conform to RFC7230 specification
390
+ - Etag correctly marks etags as weak
391
+ - Request#port supports multiple x-http-forwarded-proto values
392
+ - Utils#multipart_part_limit configures the maximum number of parts a request can contain
393
+ - Default host to localhost when in development mode
394
+ - Various bugfixes and performance improvements
395
+
396
+ ## [1.5.2] 2013-02-07
397
+ - Fix CVE-2013-0263, timing attack against Rack::Session::Cookie
398
+ - Fix CVE-2013-0262, symlink path traversal in Rack::File
399
+ - Add various methods to Session for enhanced Rails compatibility
400
+ - Request#trusted_proxy? now only matches whole strings
401
+ - Add JSON cookie coder, to be default in Rack 1.6+ due to security concerns
402
+ - URLMap host matching in environments that don't set the Host header fixed
403
+ - Fix a race condition that could result in overwritten pidfiles
404
+ - Various documentation additions
405
+
406
+ ## [1.4.5] 2013-02-07
407
+ - Fix CVE-2013-0263, timing attack against Rack::Session::Cookie
408
+ - Fix CVE-2013-0262, symlink path traversal in Rack::File
409
+
410
+ ## [1.1.6, 1.2.8, 1.3.10] 2013-02-07
411
+ - Fix CVE-2013-0263, timing attack against Rack::Session::Cookie
412
+
413
+ ## [1.5.1] 2013-01-28
414
+ - Rack::Lint check_hijack now conforms to other parts of SPEC
415
+ - Added hash-like methods to Abstract::ID::SessionHash for compatibility
416
+ - Various documentation corrections
417
+
418
+ ## [1.5.0] 2013-01-21
419
+ - Introduced hijack SPEC, for before-response and after-response hijacking
420
+ - SessionHash is no longer a Hash subclass
421
+ - Rack::File cache_control parameter is removed, in place of headers options
422
+ - Rack::Auth::AbstractRequest#scheme now yields strings, not symbols
423
+ - Rack::Utils cookie functions now format expires in RFC 2822 format
424
+ - Rack::File now has a default mime type
425
+ - rackup -b 'run Rack::Files.new(".")', option provides command line configs
426
+ - Rack::Deflater will no longer double encode bodies
427
+ - Rack::Mime#match? provides convenience for Accept header matching
428
+ - Rack::Utils#q_values provides splitting for Accept headers
429
+ - Rack::Utils#best_q_match provides a helper for Accept headers
430
+ - Rack::Handler.pick provides convenience for finding available servers
431
+ - Puma added to the list of default servers (preferred over Webrick)
432
+ - Various middleware now correctly close body when replacing it
433
+ - Rack::Request#params is no longer persistent with only GET params
434
+ - Rack::Request#update_param and #delete_param provide persistent operations
435
+ - Rack::Request#trusted_proxy? now returns true for local unix sockets
436
+ - Rack::Response no longer forces Content-Types
437
+ - Rack::Sendfile provides local mapping configuration options
438
+ - Rack::Utils#rfc2109 provides old netscape style time output
439
+ - Updated HTTP status codes
440
+ - Ruby 1.8.6 likely no longer passes tests, and is no longer fully supported
441
+
442
+ ## [1.4.4, 1.3.9, 1.2.7, 1.1.5] 2013-01-13
443
+ - [SEC] Rack::Auth::AbstractRequest no longer symbolizes arbitrary strings
444
+ - Fixed erroneous test case in the 1.3.x series
445
+
446
+ ## [1.4.3] 2013-01-07
447
+ - Security: Prevent unbounded reads in large multipart boundaries
448
+
449
+ ## [1.3.8] 2013-01-07
450
+ - Security: Prevent unbounded reads in large multipart boundaries
451
+
452
+ ## [1.4.2] 2013-01-06
453
+ - Add warnings when users do not provide a session secret
454
+ - Fix parsing performance for unquoted filenames
455
+ - Updated URI backports
456
+ - Fix URI backport version matching, and silence constant warnings
457
+ - Correct parameter parsing with empty values
458
+ - Correct rackup '-I' flag, to allow multiple uses
459
+ - Correct rackup pidfile handling
460
+ - Report rackup line numbers correctly
461
+ - Fix request loops caused by non-stale nonces with time limits
462
+ - Fix reloader on Windows
463
+ - Prevent infinite recursions from Response#to_ary
464
+ - Various middleware better conforms to the body close specification
465
+ - Updated language for the body close specification
466
+ - Additional notes regarding ECMA escape compatibility issues
467
+ - Fix the parsing of multiple ranges in range headers
468
+ - Prevent errors from empty parameter keys
469
+ - Added PATCH verb to Rack::Request
470
+ - Various documentation updates
471
+ - Fix session merge semantics (fixes rack-test)
472
+ - Rack::Static :index can now handle multiple directories
473
+ - All tests now utilize Rack::Lint (special thanks to Lars Gierth)
474
+ - Rack::File cache_control parameter is now deprecated, and removed by 1.5
475
+ - Correct Rack::Directory script name escaping
476
+ - Rack::Static supports header rules for sophisticated configurations
477
+ - Multipart parsing now works without a Content-Length header
478
+ - New logos courtesy of Zachary Scott!
479
+ - Rack::BodyProxy now explicitly defines #each, useful for C extensions
480
+ - Cookies that are not URI escaped no longer cause exceptions
481
+
482
+ ## [1.3.7] 2013-01-06
483
+ - Add warnings when users do not provide a session secret
484
+ - Fix parsing performance for unquoted filenames
485
+ - Updated URI backports
486
+ - Fix URI backport version matching, and silence constant warnings
487
+ - Correct parameter parsing with empty values
488
+ - Correct rackup '-I' flag, to allow multiple uses
489
+ - Correct rackup pidfile handling
490
+ - Report rackup line numbers correctly
491
+ - Fix request loops caused by non-stale nonces with time limits
492
+ - Fix reloader on Windows
493
+ - Prevent infinite recursions from Response#to_ary
494
+ - Various middleware better conforms to the body close specification
495
+ - Updated language for the body close specification
496
+ - Additional notes regarding ECMA escape compatibility issues
497
+ - Fix the parsing of multiple ranges in range headers
498
+
499
+ ## [1.2.6] 2013-01-06
500
+ - Add warnings when users do not provide a session secret
501
+ - Fix parsing performance for unquoted filenames
502
+
503
+ ## [1.1.4] 2013-01-06
504
+ - Add warnings when users do not provide a session secret
505
+
506
+ ## [1.4.1] 2012-01-22
507
+ - Alter the keyspace limit calculations to reduce issues with nested params
508
+ - Add a workaround for multipart parsing where files contain unescaped "%"
509
+ - Added Rack::Response::Helpers#method_not_allowed? (code 405)
510
+ - Rack::File now returns 404 for illegal directory traversals
511
+ - Rack::File now returns 405 for illegal methods (non HEAD/GET)
512
+ - Rack::Cascade now catches 405 by default, as well as 404
513
+ - Cookies missing '--' no longer cause an exception to be raised
514
+ - Various style changes and documentation spelling errors
515
+ - Rack::BodyProxy always ensures to execute its block
516
+ - Additional test coverage around cookies and secrets
517
+ - Rack::Session::Cookie can now be supplied either secret or old_secret
518
+ - Tests are no longer dependent on set order
519
+ - Rack::Static no longer defaults to serving index files
520
+ - Rack.release was fixed
521
+
522
+ ## [1.4.0] 2011-12-28
523
+ - Ruby 1.8.6 support has officially been dropped. Not all tests pass.
524
+ - Raise sane error messages for broken config.ru
525
+ - Allow combining run and map in a config.ru
526
+ - Rack::ContentType will not set Content-Type for responses without a body
527
+ - Status code 205 does not send a response body
528
+ - Rack::Response::Helpers will not rely on instance variables
529
+ - Rack::Utils.build_query no longer outputs '=' for nil query values
530
+ - Various mime types added
531
+ - Rack::MockRequest now supports HEAD
532
+ - Rack::Directory now supports files that contain RFC3986 reserved chars
533
+ - Rack::File now only supports GET and HEAD requests
534
+ - Rack::Server#start now passes the block to Rack::Handler::<h>#run
535
+ - Rack::Static now supports an index option
536
+ - Added the Teapot status code
537
+ - rackup now defaults to Thin instead of Mongrel (if installed)
538
+ - Support added for HTTP_X_FORWARDED_SCHEME
539
+ - Numerous bug fixes, including many fixes for new and alternate rubies
540
+
541
+ ## [1.1.3] 2011-12-28
542
+ - Security fix. http://www.ocert.org/advisories/ocert-2011-003.html
543
+ Further information here: http://jruby.org/2011/12/27/jruby-1-6-5-1
544
+
545
+ ## [1.3.5] 2011-10-17
546
+ - Fix annoying warnings caused by the backport in 1.3.4
547
+
548
+ ## [1.3.4] 2011-10-01
549
+ - Backport security fix from 1.9.3, also fixes some roundtrip issues in URI
550
+ - Small documentation update
551
+ - Fix an issue where BodyProxy could cause an infinite recursion
552
+ - Add some supporting files for travis-ci
553
+
554
+ ## [1.2.4] 2011-09-16
555
+ - Fix a bug with MRI regex engine to prevent XSS by malformed unicode
556
+
557
+ ## [1.3.3] 2011-09-16
558
+ - Fix bug with broken query parameters in Rack::ShowExceptions
559
+ - Rack::Request#cookies no longer swallows exceptions on broken input
560
+ - Prevents XSS attacks enabled by bug in Ruby 1.8's regexp engine
561
+ - Rack::ConditionalGet handles broken If-Modified-Since helpers
562
+
563
+ ## [1.3.2] 2011-07-16
564
+ - Fix for Rails and rack-test, Rack::Utils#escape calls to_s
565
+
566
+ ## [1.3.1] 2011-07-13
567
+ - Fix 1.9.1 support
568
+ - Fix JRuby support
569
+ - Properly handle $KCODE in Rack::Utils.escape
570
+ - Make method_missing/respond_to behavior consistent for Rack::Lock,
571
+ Rack::Auth::Digest::Request and Rack::Multipart::UploadedFile
572
+ - Reenable passing rack.session to session middleware
573
+ - Rack::CommonLogger handles streaming responses correctly
574
+ - Rack::MockResponse calls close on the body object
575
+ - Fix a DOS vector from MRI stdlib backport
576
+
577
+ ## [1.2.3] 2011-05-22
578
+ - Pulled in relevant bug fixes from 1.3
579
+ - Fixed 1.8.6 support
580
+
581
+ ## [1.3.0] 2011-05-22
582
+ - Various performance optimizations
583
+ - Various multipart fixes
584
+ - Various multipart refactors
585
+ - Infinite loop fix for multipart
586
+ - Test coverage for Rack::Server returns
587
+ - Allow files with '..', but not path components that are '..'
588
+ - rackup accepts handler-specific options on the command line
589
+ - Request#params no longer merges POST into GET (but returns the same)
590
+ - Use URI.encode_www_form_component instead. Use core methods for escaping.
591
+ - Allow multi-line comments in the config file
592
+ - Bug L#94 reported by Nikolai Lugovoi, query parameter unescaping.
593
+ - Rack::Response now deletes Content-Length when appropriate
594
+ - Rack::Deflater now supports streaming
595
+ - Improved Rack::Handler loading and searching
596
+ - Support for the PATCH verb
597
+ - env['rack.session.options'] now contains session options
598
+ - Cookies respect renew
599
+ - Session middleware uses SecureRandom.hex
600
+
601
+ ## [1.2.2, 1.1.2] 2011-03-13
602
+ - Security fix in Rack::Auth::Digest::MD5: when authenticator
603
+ returned nil, permission was granted on empty password.
604
+
605
+ ## [1.2.1] 2010-06-15
606
+ - Make CGI handler rewindable
607
+ - Rename spec/ to test/ to not conflict with SPEC on lesser
608
+ operating systems
609
+
610
+ ## [1.2.0] 2010-06-13
611
+ - Removed Camping adapter: Camping 2.0 supports Rack as-is
612
+ - Removed parsing of quoted values
613
+ - Add Request.trace? and Request.options?
614
+ - Add mime-type for .webm and .htc
615
+ - Fix HTTP_X_FORWARDED_FOR
616
+ - Various multipart fixes
617
+ - Switch test suite to bacon
618
+
619
+ ## [1.1.0] 2010-01-03
620
+ - Moved Auth::OpenID to rack-contrib.
621
+ - SPEC change that relaxes Lint slightly to allow subclasses of the
622
+ required types
623
+ - SPEC change to document rack.input binary mode in greator detail
624
+ - SPEC define optional rack.logger specification
625
+ - File servers support X-Cascade header
626
+ - Imported Config middleware
627
+ - Imported ETag middleware
628
+ - Imported Runtime middleware
629
+ - Imported Sendfile middleware
630
+ - New Logger and NullLogger middlewares
631
+ - Added mime type for .ogv and .manifest.
632
+ - Don't squeeze PATH_INFO slashes
633
+ - Use Content-Type to determine POST params parsing
634
+ - Update Rack::Utils::HTTP_STATUS_CODES hash
635
+ - Add status code lookup utility
636
+ - Response should call #to_i on the status
637
+ - Add Request#user_agent
638
+ - Request#host knows about forwarded host
639
+ - Return an empty string for Request#host if HTTP_HOST and
640
+ SERVER_NAME are both missing
641
+ - Allow MockRequest to accept hash params
642
+ - Optimizations to HeaderHash
643
+ - Refactored rackup into Rack::Server
644
+ - Added Utils.build_nested_query to complement Utils.parse_nested_query
645
+ - Added Utils::Multipart.build_multipart to complement
646
+ Utils::Multipart.parse_multipart
647
+ - Extracted set and delete cookie helpers into Utils so they can be
648
+ used outside Response
649
+ - Extract parse_query and parse_multipart in Request so subclasses
650
+ can change their behavior
651
+ - Enforce binary encoding in RewindableInput
652
+ - Set correct external_encoding for handlers that don't use RewindableInput
653
+
654
+ ## [1.0.1] 2009-10-18
655
+ - Bump remainder of rack.versions.
656
+ - Support the pure Ruby FCGI implementation.
657
+ - Fix for form names containing "=": split first then unescape components
658
+ - Fixes the handling of the filename parameter with semicolons in names.
659
+ - Add anchor to nested params parsing regexp to prevent stack overflows
660
+ - Use more compatible gzip write api instead of "<<".
661
+ - Make sure that Reloader doesn't break when executed via ruby -e
662
+ - Make sure WEBrick respects the :Host option
663
+ - Many Ruby 1.9 fixes.
664
+
665
+ ## [1.0.0] 2009-04-25
666
+ - SPEC change: Rack::VERSION has been pushed to [1,0].
667
+ - SPEC change: header values must be Strings now, split on "\n".
668
+ - SPEC change: Content-Length can be missing, in this case chunked transfer
669
+ encoding is used.
670
+ - SPEC change: rack.input must be rewindable and support reading into
671
+ a buffer, wrap with Rack::RewindableInput if it isn't.
672
+ - SPEC change: rack.session is now specified.
673
+ - SPEC change: Bodies can now additionally respond to #to_path with
674
+ a filename to be served.
675
+ - NOTE: String bodies break in 1.9, use an Array consisting of a
676
+ single String instead.
677
+ - New middleware Rack::Lock.
678
+ - New middleware Rack::ContentType.
679
+ - Rack::Reloader has been rewritten.
680
+ - Major update to Rack::Auth::OpenID.
681
+ - Support for nested parameter parsing in Rack::Response.
682
+ - Support for redirects in Rack::Response.
683
+ - HttpOnly cookie support in Rack::Response.
684
+ - The Rakefile has been rewritten.
685
+ - Many bugfixes and small improvements.
686
+
687
+ ## [0.9.1] 2009-01-09
688
+ - Fix directory traversal exploits in Rack::File and Rack::Directory.
689
+
690
+ ## [0.9] 2009-01-06
691
+ - Rack is now managed by the Rack Core Team.
692
+ - Rack::Lint is stricter and follows the HTTP RFCs more closely.
693
+ - Added ConditionalGet middleware.
694
+ - Added ContentLength middleware.
695
+ - Added Deflater middleware.
696
+ - Added Head middleware.
697
+ - Added MethodOverride middleware.
698
+ - Rack::Mime now provides popular MIME-types and their extension.
699
+ - Mongrel Header now streams.
700
+ - Added Thin handler.
701
+ - Official support for swiftiplied Mongrel.
702
+ - Secure cookies.
703
+ - Made HeaderHash case-preserving.
704
+ - Many bugfixes and small improvements.
705
+
706
+ ## [0.4] 2008-08-21
707
+ - New middleware, Rack::Deflater, by Christoffer Sawicki.
708
+ - OpenID authentication now needs ruby-openid 2.
709
+ - New Memcache sessions, by blink.
710
+ - Explicit EventedMongrel handler, by Joshua Peek <josh@joshpeek.com>
711
+ - Rack::Reloader is not loaded in rackup development mode.
712
+ - rackup can daemonize with -D.
713
+ - Many bugfixes, especially for pool sessions, URLMap, thread safety
714
+ and tempfile handling.
715
+ - Improved tests.
716
+ - Rack moved to Git.
717
+
718
+ ## [0.3] 2008-02-26
719
+ - LiteSpeed handler, by Adrian Madrid.
720
+ - SCGI handler, by Jeremy Evans.
721
+ - Pool sessions, by blink.
722
+ - OpenID authentication, by blink.
723
+ - :Port and :File options for opening FastCGI sockets, by blink.
724
+ - Last-Modified HTTP header for Rack::File, by blink.
725
+ - Rack::Builder#use now accepts blocks, by Corey Jewett.
726
+ (See example/protectedlobster.ru)
727
+ - HTTP status 201 can contain a Content-Type and a body now.
728
+ - Many bugfixes, especially related to Cookie handling.
729
+
730
+ ## [0.2] 2007-05-16
731
+ - HTTP Basic authentication.
732
+ - Cookie Sessions.
733
+ - Static file handler.
734
+ - Improved Rack::Request.
735
+ - Improved Rack::Response.
736
+ - Added Rack::ShowStatus, for better default error messages.
737
+ - Bug fixes in the Camping adapter.
738
+ - Removed Rails adapter, was too alpha.
739
+
740
+ ## [0.1] 2007-03-03