Skip to content

Releases: rack/rack-contrib

Omnibus release of dooooooooom

30 Nov 23:50
095edc9
Compare
Choose a tag to compare

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 contributions!

31 Mar 21:15
143055e
Compare
Choose a tag to compare

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::PostBodyContentTypeParser: 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

04 Oct 03:18
Compare
Choose a tag to compare

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!

08 Dec 05:31
a7eb3f4
Compare
Choose a tag to compare

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!

30 Nov 08:58
Compare
Choose a tag to compare

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

08 Nov 00:18
Compare
Choose a tag to compare

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

01 Oct 01:45
Compare
Choose a tag to compare
  • 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 by Juan C.
    Muller (@jcmuller).

September is the season of correct error handling

01 Sep 01:01
Compare
Choose a tag to compare
  • 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.

We're baaaaaaack!

19 Jul 00:04
Compare
Choose a tag to compare

After an extended hiatus, rack-contrib maintenance is back on track. This
is a tidy-up release, merging things that have sat around for far too long.

  • git-version-bump has now been moved to being a development dependency,
    thanks to Tobias Haagen Michaelsen.

  • Rack::AcceptLocale can be restricted to a set of enforced locales, thanks
    to Paco Guzman.

  • Rack::NotFound's path argument is now optional, thanks to Ed Morley.

  • Rack::BounceFavicon now has a description and tests, thanks to Steven
    Wilkin.

  • The automated Travis CI suite now tests all supported Ruby versions up to
    2.4, which necessitated a few small changes.

v1.4.0: Features, Features Everywhere, and not a bug to fix

02 Aug 05:18
Compare
Choose a tag to compare

There's a bumper crop of new features this month. Share and enjoy!

Deprecations

  • Rack::AcceptFormat is slated for removal in rack-contrib 2.0.0 (due
    on or after 1 January, 2016
    . Using this middleware will now result in a
    deprecation warning being printed to stderr. If you use this
    middleware, now would be a good time to start doing things properly.

Features

  • Rack::LazyConditionalGet: new middleware, by
    Mig. This middleware tracks when the last
    POST/PUT/DELETE request was made, and returns 304 responses to requests
    which include a Last-Modified entity request header which is greater
    than or equal to that time.
  • Rack::StaticCache: You can now specify a custom "version" regex for your
    cache invalidation, if the default doesn't do it for you. Initial patch
    provided by Eric Boehs.
  • Rack::Profiler: You can now run a single request through the profiler
    multiple times, by adding the profiler_runs query parameter to the URL.
    Patch provided by Bryce McDonnell.