Rack::Hackery

A set of small Rack middlewares collected from here and there...

Installation

Add this line to your application's Gemfile:

gem 'rack-hackery'

And then execute:

bundle

Or install it yourself as:

gem install rack-hackery

What's included

  • A modified version of Rack::ETag that's supposed to fix the ugly Safari 7/8 ETag caching problem.
  • A JSON response prettifier.

Usage

Rack::Hackery::Etag

In either config/application.rb or config/environments/{development,production}.rb:

config.middleware.swap Rack::ETag, Rack::Hackery::ETag

Rack::Hackery::PrettyJsonResponse

In either config/application.rb or config/environments/{development,production}.rb:

config.middleware.use Rack::Hackery::PrettyJsonResponse

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new pull request