Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config option to send 404.html(.gz) files to browsers for static sites #35

Open
eliotsykes opened this issue Aug 6, 2014 · 0 comments

Comments

@eliotsykes
Copy link
Owner

rack-zippy will pass any request paths it can't fulfil down the rack middleware stack.

In a static site I've got a config.ru like this to handle the 404s:

require 'rack-zippy'
require 'rack/contrib/not_found'

asset_root = 'dist'
use Rack::Zippy::AssetServer, asset_root
run Rack::NotFound.new "#{asset_root}/404.html"

Unfortunately Rack::NotFound doesn't serve 404.html.gz. I'd like for rack-zippy to offer this as an option (off by default), where static sites can ask rack-zippy to handle 404 Not Found errors by serving 404.html.gz (if present and browser is gzip-capable), otherwise 404.html.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant