rack 3.1.15 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +83 -3
- data/README.md +41 -20
- data/SPEC.rdoc +199 -306
- data/lib/rack/auth/abstract/request.rb +2 -0
- data/lib/rack/builder.rb +6 -0
- data/lib/rack/conditional_get.rb +4 -3
- data/lib/rack/constants.rb +1 -0
- data/lib/rack/head.rb +2 -3
- data/lib/rack/lint.rb +430 -457
- data/lib/rack/media_type.rb +6 -7
- data/lib/rack/mock_response.rb +19 -25
- data/lib/rack/multipart/parser.rb +39 -11
- data/lib/rack/multipart/uploaded_file.rb +42 -5
- data/lib/rack/query_parser.rb +41 -24
- data/lib/rack/request.rb +45 -54
- data/lib/rack/rewindable_input.rb +4 -1
- data/lib/rack/show_exceptions.rb +4 -2
- data/lib/rack/show_status.rb +0 -2
- data/lib/rack/utils.rb +14 -23
- data/lib/rack/version.rb +4 -8
- data/lib/rack.rb +0 -1
- metadata +2 -2
- data/lib/rack/logger.rb +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17b6834d4c6a07c5cf23757814f450f39e32589ef0a6300310c7ab111a8c99c2
|
4
|
+
data.tar.gz: db3d1475837e3d45082994af134b5ceb9e0b83f400244c33262c343f421798f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36b2bb65194e71b496e946090552bc97f3367426d4c169b0da384ee284068dd809d9d89fc585a49caa313a48e73eea3ce4f1dd47f2a5f103da9ac006f9f6d12a
|
7
|
+
data.tar.gz: 934940c91b89ebcf4a3015d3876e850f470d97ac82e189a390ff07efed1664d153a28546f8576fa99d6e6361f168ab1c6ffd8541509ddfe709436bd649cca29d
|
data/CHANGELOG.md
CHANGED
@@ -2,12 +2,69 @@
|
|
2
2
|
|
3
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
4
|
|
5
|
+
## Unreleased
|
6
|
+
|
7
|
+
## [3.2.0] - 2025-07-31
|
8
|
+
|
9
|
+
This release continues Rack's evolution toward a cleaner, more efficient foundation while maintaining backward compatibility for most applications. The breaking changes primarily affect deprecated functionality, so most users should experience a smooth upgrade with improved performance and standards compliance.
|
10
|
+
|
11
|
+
### SPEC Changes
|
12
|
+
|
13
|
+
- Request environment keys must now be strings. ([#2310](https://github.com/rack/rack/issues/2310), [@jeremyevans])
|
14
|
+
- Add `nil` as a valid return from a Response `body.to_path` ([#2318](https://github.com/rack/rack/pull/2318), [@MSP-Greg])
|
15
|
+
- `Rack::Lint#check_header_value` is relaxed, only disallowing CR/LF/NUL characters. ([#2354](https://github.com/rack/rack/pull/2354), [@ioquatix])
|
16
|
+
|
17
|
+
### Added
|
18
|
+
|
19
|
+
- Introduce `Rack::VERSION` constant. ([#2199](https://github.com/rack/rack/pull/2199), [@ioquatix])
|
20
|
+
- `ISO-2022-JP` encoded parts within MIME Multipart sections of an HTTP request body will now be converted to `UTF-8`. ([#2245](https://github.com/rack/rack/pull/2245), [@nappa](https://github.com/nappa))
|
21
|
+
- Add `Rack::Request#query_parser=` to allow setting the query parser to use. ([#2349](https://github.com/rack/rack/pull/2349), [@jeremyevans])
|
22
|
+
- Add `Rack::Request#form_pairs` to access form data as raw key-value pairs, preserving duplicate keys. ([#2351](https://github.com/rack/rack/pull/2351), [@matthewd])
|
23
|
+
|
24
|
+
### Changed
|
25
|
+
|
26
|
+
- Invalid cookie keys will now raise an error. ([#2193](https://github.com/rack/rack/pull/2193), [@ioquatix])
|
27
|
+
- `Rack::MediaType#params` now handles empty strings. ([#2229](https://github.com/rack/rack/pull/2229), [@jeremyevans])
|
28
|
+
- Avoid unnecessary calls to the `ip_filter` lambda to evaluate `Request#ip` ([#2287](https://github.com/rack/rack/pull/2287), [@willbryant])
|
29
|
+
- Only calculate `Request#ip` once per request ([#2292](https://github.com/rack/rack/pull/2292), [@willbryant])
|
30
|
+
- `Rack::Builder` `#use`, `#map`, and `#run` methods now return `nil`. ([#2355](https://github.com/rack/rack/pull/2355), [@ioquatix])
|
31
|
+
- Directly close the body in `Rack::ConditionalGet` when the response is `304 Not Modified`. ([#2353](https://github.com/rack/rack/pull/2353), [@ioquatix])
|
32
|
+
- Directly close the body in `Rack::Head` when the request method is `HEAD`([#2360](https://github.com/rack/rack/pull/2360), [@skipkayhil](https://github.com/skipkayhil))
|
33
|
+
|
34
|
+
### Deprecated
|
35
|
+
|
36
|
+
- `Rack::Auth::AbstractRequest#request` is deprecated without replacement. ([#2229](https://github.com/rack/rack/pull/2229), [@jeremyevans])
|
37
|
+
- `Rack::Request#parse_multipart` (private method designed to be overridden in subclasses) is deprecated without replacement. ([#2229](https://github.com/rack/rack/pull/2229), [@jeremyevans])
|
38
|
+
|
39
|
+
### Removed
|
40
|
+
|
41
|
+
- `Rack::Request#values_at` is removed. ([#2200](https://github.com/rack/rack/pull/2200), [@ioquatix])
|
42
|
+
- `Rack::Logger` is removed with no replacement. ([#2196](https://github.com/rack/rack/pull/2196), [@ioquatix])
|
43
|
+
- Automatic cache invalidation in `Rack::Request#{GET,POST}` has been removed. ([#2230](https://github.com/rack/rack/pull/2230), [@jeremyevans])
|
44
|
+
- Support for `CGI::Cookie` has been removed. ([#2332](https://github.com/rack/rack/pull/2332), [@ioquatix])
|
45
|
+
|
46
|
+
### Fixed
|
47
|
+
|
48
|
+
- `Rack::RewindableInput::Middleware` no longer wraps a nil input. ([#2259](https://github.com/rack/rack/pull/2259), [@tt](https://github.com/tt))
|
49
|
+
- Fix `NoMethodError` in `Rack::Request#wrap_ipv6` when `x-forwarded-host` is empty. ([#2270](https://github.com/rack/rack/pull/2270), [@oieioi](https://github.com/oieioi))
|
50
|
+
- Fix the specification for `SERVER_PORT` which was incorrectly documented as required to be an `Integer` if present - it must be a `String` containing digits only. ([#2296](https://github.com/rack/rack/pull/2296), [@ioquatix])
|
51
|
+
- `SERVER_NAME` and `HTTP_HOST` are now more strictly validated according to the relevant specifications. ([#2298](https://github.com/rack/rack/pull/2298), [@ioquatix])
|
52
|
+
- `Rack::Lint` now disallows `PATH_INFO="" SCRIPT_NAME=""`. ([#2298](https://github.com/rack/rack/issues/2307), [@jeremyevans])
|
53
|
+
|
54
|
+
## [3.1.16] - 2025-06-04
|
55
|
+
|
56
|
+
### Security
|
57
|
+
|
58
|
+
- [CVE-2025-49007](https://github.com/advisories/GHSA-47m2-26rw-j2jw) Fix ReDoS in multipart request.
|
59
|
+
|
5
60
|
## [3.1.15] - 2025-05-18
|
6
61
|
|
7
62
|
- Optional support for `CGI::Cookie` if not available. ([#2327](https://github.com/rack/rack/pull/2327), [#2333](https://github.com/rack/rack/pull/2333), [@earlopain])
|
8
63
|
|
9
64
|
## [3.1.14] - 2025-05-06
|
10
65
|
|
66
|
+
:warning: **This release includes a security fix that may cause certain routes in previously working applications to fail if query parameters exceed 4,096 in count or 4 MB in total size. See <https://github.com/rack/rack/discussions/2356> for more details.**
|
67
|
+
|
11
68
|
### Security
|
12
69
|
|
13
70
|
- [CVE-2025-46727](https://github.com/rack/rack/security/advisories/GHSA-gjh7-p2fx-99vx) Unbounded parameter parsing in `Rack::QueryParser` can lead to memory exhaustion.
|
@@ -92,7 +149,7 @@ All notable changes to this project will be documented in this file. For info on
|
|
92
149
|
|
93
150
|
:warning: **This release includes several breaking changes.** Refer to the **Removed** section below for the list of deprecated methods that have been removed in this release.
|
94
151
|
|
95
|
-
|
152
|
+
This release is primarily a maintenance release that removes features deprecated in Rack v3.0. Alongside these removals, there are several improvements to the Rack SPEC, mainly focused on enhancing input and output handling. These changes aim to make Rack more efficient and align better with the requirements of server implementations and relevant HTTP specifications.
|
96
153
|
|
97
154
|
### SPEC Changes
|
98
155
|
|
@@ -143,13 +200,18 @@ Rack v3.1 is primarily a maintenance release that removes features deprecated in
|
|
143
200
|
|
144
201
|
- In `Rack::Files`, ignore the `Range` header if served file is 0 bytes. ([#2159](https://github.com/rack/rack/pull/2159), [@zarqman])
|
145
202
|
|
203
|
+
## [3.0.18] - 2025-05-22
|
204
|
+
|
205
|
+
- Fix incorrect backport of optional `CGI::Cookie` support. ([#2335](https://github.com/rack/rack/pull/2335), [@jeremyevans])
|
206
|
+
|
146
207
|
## [3.0.17] - 2025-05-18
|
147
208
|
|
148
209
|
- Optional support for `CGI::Cookie` if not available. ([#2327](https://github.com/rack/rack/pull/2327), [#2333](https://github.com/rack/rack/pull/2333), [@earlopain])
|
149
210
|
|
150
|
-
|
151
211
|
## [3.0.16] - 2025-05-06
|
152
212
|
|
213
|
+
:warning: **This release includes a security fix that may cause certain routes in previously working applications to fail if query parameters exceed 4,096 in count or 4 MB in total size. See <https://github.com/rack/rack/discussions/2356> for more details.**
|
214
|
+
|
153
215
|
### Security
|
154
216
|
|
155
217
|
- [CVE-2025-46727](https://github.com/rack/rack/security/advisories/GHSA-gjh7-p2fx-99vx) Unbounded parameter parsing in `Rack::QueryParser` can lead to memory exhaustion.
|
@@ -170,6 +232,10 @@ Rack v3.1 is primarily a maintenance release that removes features deprecated in
|
|
170
232
|
|
171
233
|
- [CVE-2025-27111](https://github.com/rack/rack/security/advisories/GHSA-8cgq-6mh2-7j6v) Possible Log Injection in `Rack::Sendfile`.
|
172
234
|
|
235
|
+
### Fixed
|
236
|
+
|
237
|
+
- Remove autoloads for constants no longer shipped with Rack. ([#2269](https://github.com/rack/rack/pull/2269), [@ccutrer](https://github.com/ccutrer))
|
238
|
+
|
173
239
|
## [3.0.12] - 2025-02-12
|
174
240
|
|
175
241
|
### Security
|
@@ -264,6 +330,8 @@ Rack v3.1 is primarily a maintenance release that removes features deprecated in
|
|
264
330
|
|
265
331
|
## [3.0.0] - 2022-09-06
|
266
332
|
|
333
|
+
This release introduces major improvements to Rack, including enhanced support for streaming responses, expanded protocol handling, and stricter compliance with HTTP standards. It refines middleware interfaces, improves multipart and hijack handling, and strengthens security and error reporting. The update also brings performance optimizations, better compatibility with modern Ruby versions, and numerous bug fixes, making Rack more robust and flexible for web application development.
|
334
|
+
|
267
335
|
- No changes
|
268
336
|
|
269
337
|
## [3.0.0.rc1] - 2022-09-04
|
@@ -304,7 +372,7 @@ Rack v3.1 is primarily a maintenance release that removes features deprecated in
|
|
304
372
|
- Remove deprecated Rack::Request::SCHEME_WHITELIST. ([@jeremyevans])
|
305
373
|
- 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])
|
306
374
|
- Remove `rack.version` as it comes too late to be useful. ([#1938](https://github.com/rack/rack/pull/1938), [@ioquatix])
|
307
|
-
- Extract `rackup` command, `Rack::Server`, `Rack::Handler
|
375
|
+
- Extract `rackup` command, `Rack::Server`, `Rack::Handler` and related code into a separate gem. ([#1937](https://github.com/rack/rack/pull/1937), [@ioquatix])
|
308
376
|
|
309
377
|
### Added
|
310
378
|
|
@@ -352,12 +420,22 @@ Rack v3.1 is primarily a maintenance release that removes features deprecated in
|
|
352
420
|
- 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))
|
353
421
|
- `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))
|
354
422
|
|
423
|
+
## [2.2.17] - 2025-06-03
|
424
|
+
|
425
|
+
- Backport `Rack::MediaType#params` now handles parameters without values. ([#2263](https://github.com/rack/rack/pull/2263), [@AllyMarthaJ](https://github.com/AllyMarthaJ))
|
426
|
+
|
427
|
+
## [2.2.16] - 2025-05-22
|
428
|
+
|
429
|
+
- Fix incorrect backport of optional `CGI::Cookie` support. ([#2335](https://github.com/rack/rack/pull/2335), [@jeremyevans])
|
430
|
+
|
355
431
|
## [2.2.15] - 2025-05-18
|
356
432
|
|
357
433
|
- Optional support for `CGI::Cookie` if not available. ([#2327](https://github.com/rack/rack/pull/2327), [#2333](https://github.com/rack/rack/pull/2333), [@earlopain])
|
358
434
|
|
359
435
|
## [2.2.14] - 2025-05-06
|
360
436
|
|
437
|
+
:warning: **This release includes a security fix that may cause certain routes in previously working applications to fail if query parameters exceed 4,096 in count or 4 MB in total size. See <https://github.com/rack/rack/discussions/2356> for more details.**
|
438
|
+
|
361
439
|
### Security
|
362
440
|
|
363
441
|
- [CVE-2025-46727](https://github.com/rack/rack/security/advisories/GHSA-gjh7-p2fx-99vx) Unbounded parameter parsing in `Rack::QueryParser` can lead to memory exhaustion.
|
@@ -1144,3 +1222,5 @@ Items below this line are from the previously maintained HISTORY.md and NEWS.md
|
|
1144
1222
|
[@BlakeWilliams]: https://github.com/BlakeWilliams "Blake Williams"
|
1145
1223
|
[@davidstosik]: https://github.com/davidstosik "David Stosik"
|
1146
1224
|
[@earlopain]: https://github.com/earlopain "Earlopain"
|
1225
|
+
[@wynksaiddestroy]: https://github.com/wynksaiddestroy "Fabian Winkler"
|
1226
|
+
[@matthewd]: https://github.com/matthewd "Matthew Draper"
|
data/README.md
CHANGED
@@ -6,26 +6,43 @@ way possible, it unifies and distills the bridge between web servers, web
|
|
6
6
|
frameworks, and web application into a single method call.
|
7
7
|
|
8
8
|
The exact details of this are described in the [Rack Specification], which all
|
9
|
-
Rack applications should conform to.
|
9
|
+
Rack applications should conform to. Browse the [Documentation] for more
|
10
|
+
information.
|
10
11
|
|
11
12
|
## Version support
|
12
13
|
|
13
14
|
| Version | Support |
|
14
15
|
|----------|------------------------------------|
|
15
|
-
| 3.
|
16
|
+
| 3.2.x | Bug fixes and security patches. |
|
17
|
+
| 3.1.x | Security patches only. |
|
18
|
+
| 3.0.x | End of support. |
|
16
19
|
| 2.2.x | Security patches only. |
|
17
20
|
| <= 2.1.x | End of support. |
|
18
21
|
|
22
|
+
**Rack 2.2.x is in security maintenance mode**. Please upgrade to Rack 3.1+ as soon
|
23
|
+
as possible to ensure you are receiving the latest features and security patches.
|
24
|
+
|
19
25
|
Please see the [Security Policy] for more information.
|
20
26
|
|
21
|
-
##
|
27
|
+
## Change log
|
28
|
+
|
29
|
+
See the [Changelog](CHANGELOG.md) for a detailed list of changes in each version of Rack.
|
30
|
+
|
31
|
+
### Rack 3.2 (latest release)
|
32
|
+
|
33
|
+
This version of rack contains bug fixes and security patches.
|
22
34
|
|
23
|
-
|
24
|
-
breaking changes. Please check the [Upgrade Guide](UPGRADE-GUIDE.md) for more
|
25
|
-
details about migrating servers, middlewares and applications designed for Rack 2
|
26
|
-
to Rack 3. For detailed information on specific changes, check the [Change Log](CHANGELOG.md).
|
35
|
+
### Rack 3.1
|
27
36
|
|
28
|
-
|
37
|
+
This version of rack contains bug fixes and security patches.
|
38
|
+
|
39
|
+
### Rack 3.0
|
40
|
+
|
41
|
+
This version of rack contains significant changes which are detailed in the
|
42
|
+
[Upgrade Guide](UPGRADE-GUIDE.md). It is recommended to upgrade to Rack 3 as soon
|
43
|
+
as possible to receive the latest features and security patches.
|
44
|
+
|
45
|
+
### Rack 2.2
|
29
46
|
|
30
47
|
This version of Rack is receiving security patches only, and effort should be
|
31
48
|
made to move to Rack 3.
|
@@ -69,6 +86,8 @@ server](#supported-web-servers).
|
|
69
86
|
```bash
|
70
87
|
$ gem install rackup
|
71
88
|
$ rackup
|
89
|
+
|
90
|
+
# In another shell:
|
72
91
|
$ curl http://localhost:9292
|
73
92
|
Hello World
|
74
93
|
```
|
@@ -83,6 +102,7 @@ Rack is supported by a wide range of servers, including:
|
|
83
102
|
* [NGINX Unit](https://unit.nginx.org/)
|
84
103
|
* [Phusion Passenger](https://www.phusionpassenger.com/) (which is mod_rack for
|
85
104
|
Apache and for nginx)
|
105
|
+
* [Pitchfork](https://github.com/Shopify/pitchfork)
|
86
106
|
* [Puma](https://puma.io/)
|
87
107
|
* [Thin](https://github.com/macournoyer/thin)
|
88
108
|
* [Unicorn](https://yhbt.net/unicorn/)
|
@@ -132,11 +152,9 @@ middleware:
|
|
132
152
|
* `Rack::ETag` for setting `etag` header on bodies that can be buffered.
|
133
153
|
* `Rack::Events` for providing easy hooks when a request is received and when
|
134
154
|
the response is sent.
|
135
|
-
* `Rack::Files` for serving static files.
|
136
155
|
* `Rack::Head` for returning an empty body for HEAD requests.
|
137
156
|
* `Rack::Lint` for checking conformance to the [Rack Specification].
|
138
157
|
* `Rack::Lock` for serializing requests using a mutex.
|
139
|
-
* `Rack::Logger` for setting a logger to handle logging errors.
|
140
158
|
* `Rack::MethodOverride` for modifying the request method based on a submitted
|
141
159
|
parameter.
|
142
160
|
* `Rack::Recursive` for including data from other paths in the application, and
|
@@ -150,7 +168,7 @@ middleware:
|
|
150
168
|
a nice and helpful way with clickable backtrace.
|
151
169
|
* `Rack::ShowStatus` for using nice error pages for empty client error
|
152
170
|
responses.
|
153
|
-
* `Rack::Static` for
|
171
|
+
* `Rack::Static` for configurable serving of static files.
|
154
172
|
* `Rack::TempfileReaper` for removing temporary files creating during a request.
|
155
173
|
|
156
174
|
All these components use the same interface, which is described in detail in the
|
@@ -172,6 +190,8 @@ quickly and without doing the same web stuff all over:
|
|
172
190
|
returns a not found or method not supported response.
|
173
191
|
* `Rack::Directory` for serving files under a given directory, with directory
|
174
192
|
indexes.
|
193
|
+
* `Rack::Files` for serving files under a given directory, without directory
|
194
|
+
indexes.
|
175
195
|
* `Rack::MediaType` for parsing content-type headers.
|
176
196
|
* `Rack::Mime` for determining content-type based on file extension.
|
177
197
|
* `Rack::RewindableInput` for making any IO object rewindable, using a temporary
|
@@ -247,7 +267,6 @@ Can also be set via the `RACK_MULTIPART_FILE_LIMIT` environment variable.
|
|
247
267
|
|
248
268
|
(This is also aliased as `multipart_part_limit` and `RACK_MULTIPART_PART_LIMIT` for compatibility)
|
249
269
|
|
250
|
-
|
251
270
|
### `multipart_total_part_limit`
|
252
271
|
|
253
272
|
The maximum total number of parts a request can contain of any type, including
|
@@ -260,18 +279,12 @@ Set to 0 for no limit.
|
|
260
279
|
|
261
280
|
Can also be set via the `RACK_MULTIPART_TOTAL_PART_LIMIT` environment variable.
|
262
281
|
|
263
|
-
|
264
|
-
## Changelog
|
265
|
-
|
266
|
-
See [CHANGELOG.md](CHANGELOG.md).
|
267
|
-
|
268
282
|
## Contributing
|
269
283
|
|
270
284
|
See [CONTRIBUTING.md](CONTRIBUTING.md) for specific details about how to make a
|
271
285
|
contribution to Rack.
|
272
286
|
|
273
|
-
Please post bugs, suggestions and patches to [GitHub
|
274
|
-
Issues](https://github.com/rack/rack/issues).
|
287
|
+
Please post bugs, suggestions and patches to [GitHub Issues](https://github.com/rack/rack/issues).
|
275
288
|
|
276
289
|
Please check our [Security Policy](https://github.com/rack/rack/security/policy)
|
277
290
|
for responsible disclosure and security bug reporting process. Due to wide usage
|
@@ -281,6 +294,13 @@ is greatly appreciated.
|
|
281
294
|
|
282
295
|
## See Also
|
283
296
|
|
297
|
+
### `rackup`
|
298
|
+
|
299
|
+
A useful tool for running Rack applications from the command line, including
|
300
|
+
`Rackup::Server` (previously `Rack::Server`) for scripting servers.
|
301
|
+
|
302
|
+
* https://github.com/rack/rackup
|
303
|
+
|
284
304
|
### `rack-contrib`
|
285
305
|
|
286
306
|
The plethora of useful middleware created the need for a project that collects
|
@@ -351,5 +371,6 @@ would like to thank:
|
|
351
371
|
|
352
372
|
Rack is released under the [MIT License](MIT-LICENSE).
|
353
373
|
|
354
|
-
[Rack Specification]:
|
374
|
+
[Rack Specification]: https://rack.github.io/rack/main/SPEC_rdoc.html
|
375
|
+
[Documentation]: https://rack.github.io/rack/
|
355
376
|
[Security Policy]: SECURITY.md
|