Tags: rack/rack-contrib
Tags
Omnibus release of dooooooooom The list of changes in this release is long, and should serve as a warning to me to make releases more often, as it cuts down on typing. Thanks to everyone who made PRs, checked PRs, merged PRs, and... renewed PRs. Special thanks to Andrew Konchin (@andrykonchin) who is responsible for over half the changes in this monster release, and who has come on board as a maintainer. This release removes the `Rack::Runtime` and `Rack::Config` middleware. This may seem like a foolhardy thing to do in a minor release, but `rack` itself ships with functionally identical versions. Compatibility has been maintained by having `require "rack/contrib/<thing>"` still work, but that should be changed to `require "rack/<thing>"` instead. * A `#close` method was added to the body that is returned by `Rack::Signals`. * A stub `CHANGELOG.md`, pointing to the canonical source of release notes, has been added. * Thread safety issues in `Rack::Access`, `Rack::CommonCookies`, and `Rack::Deflect` have been fixed. Additionally, the need for a thread-safe external cache object in `Rack::LazyConditionalGet` has been documented. * A SPEC violation in `Rack::CSSHTTPRequest` has been fixed. * Case-sensitive header problems in a whole bunch of middlewares have been fixed. * `Rack::JSONBodyParser` now only rescues `JSON::ParserError` if it is raised within the middleware's own code. Exceptions raised by the application itself will now be left alone to be handled elsewhere. * All string literals are now frozen. * Residual ye olde Ruby compatibility checks were removed from `Rack::Backstage`, `Rack::MailExceptions` and `Rack::NestedParams`. * The length calculation in `Rack::JSONP` has been made simpler.
Stuck at home? Why not release your favourite collection of Rack cont… …ributions! A healthy crop of fixes and new features in this release. Thanks to everyone who contributed, and welcome to Andrew Konchin, as the newest recipient of a commit bit. * New middleware `Rack::JSONBodyParser`: a better-designed replacement for `Rack::PostBodyContentTypeParser`, with a more appropriate name (given that they both only handle JSON natively, having `JSON` in the name seems like a good idea), and with a better set of default behaviours and knobs. It is also *significantly* faster than `PostBodyContentTypeParser`. * **`Rack::PostBudyContentTypeParser`**: this middleware's interface is a bit of a mess, which makes it nearly impossible to improve in a backwards-compatible manner. As a result, its use has been deprecated, in favour of `Rack::JSONBodyParser`. * Several middlewares that set `Content-Length` headers were fixed to use `String#bytesize`, instead of `String#size`, which makes multibyte characters much happier. (Chris Frank) * `Rack::ResponseCache`: Make header detection case-insensitive. (Chris Frank) * A lot of broken tests and deprecation warnings in the test suite were fixed. (Andrew Konchin) * `Rack::Locale`: significant correctness fixes, including `q=0` handling, case insensitivity where appropriate, and better handling of whitespace. (Andrew Konchin) * `Rack::StaticCache`: several correctness fixes, such as setting a `Date` response header, use UTC in timestamps, and improving the robustness of the date rendering. Share and enjoy!
Spring has sprung so let's make a new release New features: * **`Rack::PostBodyContentTypeParser`** -- you can now pass a block to the middleware to override the default "parse me some JSON" behaviour. Thanks to Kris Dekeyser (@Kris-LEBIS) for the patch. * **Ruby 2.5 support** -- we're now running the test suite through Ruby 2.5.1, as well as the latest patch releases of all other Ruby releases supported by rack-contrib (back to 2.2, the same as Rack itself). The only "interesting" change here is that some `Rack::Profiler` printers no longer work, which is not our fault, but rather a problem with `ruby-prof`. Bug fixes: * Remove a deprecation warning about has_rdoc. Thanks to Luciano Sousa (@lucianosousa) for the patch.
Multibytes bytes again! This is a bugfix release, which fixes a Rack 2 incompatibility in `Rack::NotFound`, where the wrong value for the `Content-Length` response header was calculated (#143). Thanks to Kazuhiro NISHIYAMA (@znz) for the bug report, and Joe Francis (@lostapathy) for the fix.
Rack 2.x Support Is HERE! Thanks to the hard work of Skye Shaw, amongst others, this release of `rack-contrib` supports Rack 2.x. Unfortunately, it *only* supports Rack 2.x; if your application is using Rack 1.x, you should continue to use `rack-contrib` 1.x. The non-backwards-compatible, user-visible changes are: * Drop support for Ruby versions less than 2.2. Rack 2 does not support these older releases, so there's no benefit in our doing so. * `Rack::NestedParams`: switch to using `Rack::Utils.parse_nested_query` to parse request bodies, which handles repeated element keys differently. See #92. * `Rack::Sendfile`: removed completely. Rack core provides a middleware of the same name that is much better, *and* more actively maintained, and you should use that instead. * `Rack::AcceptFormat`: removed completely, because it is terribad.
End of an era: support ending for Rack 1.x This is intended to be the final release of `rack-contrib` with support for the Rack 1.x series. Deprecations have been added for the non-backwards-compatible changes, so you can get a sense of what will need to be fixed. Regular changes in this release: * `Rack::Locale`: use a default locale (specified by `I18n.default_locale = :<something>`) if no available locale matches the `Accept` header. (Hiroki Yoshioka) * Our test suite is now minitest 6 compliant, since all deprecation warnings have been cleaned up. (Skye Shaw) Deprecation warnings added: * `Rack::Sendfile` is gone, because there's a better one in Rack itself. If your code loads `rack/contrib/sendfile`, you'll get a warning. * `Rack::NestedParams` behaviour has changed if multiple instances of the same variable are found in a query string (`foo=1&foo=2` currently evaluates to `foo=1`; it will evaluate to `foo=2` in `rack-contrib` 2.x). This is necessary because we're using Rack's built-in query string parsing rather than our own rather ugly implementation. If you hit the changed behaviour, you'll get a warning. (Skye Shaw) * `Rack::AcceptFormat` -- whilst this has been deprecated for a while, it's worth reiterating that if you're still using this thing, you should really stop. It's sooooo bad.
October: catastrophe avoidance month * `Rack::JSONP`: change the callback validity checking regex to one that isn't vulnerable to catastrophic backtracking, which causes all sorts of nasty performance problems when there's a long invalid string to match against. [PR](https://github.com/rack/rack-contrib/136) by Juan C. Muller (@jcmuller).
September is the season of correct error handling * **`Rack::PostBodyContentTypeParser`**: if the middleware is told a POST body is JSON, but it doesn't parse as JSON, then... it's not really JSON, and the request is now rejected with a 400 response. Thanks to Yukihiko SAWANOBORI (@sawanoboly) for the fix.
PreviousNext