rack 2.0.9.3 → 3.0.0

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