Sha256: 5990a19c811becade1a06f1884d9e8b1ecbad355b8e8dd2409d642cf9bfccc9d
Contents?: true
Size: 406 Bytes
Versions: 9
Compression:
Stored size: 406 Bytes
Contents
class Embork::Pushstate attr_reader :app def initialize(app, options = {}) @app = app end def call(env) status, headers, body = @app.call(env) if status == 404 modified_env = env.dup modified_env['PATH_INFO'] = '/index.html' status, headers, body = @app.call(modified_env) headers['Push-State-Redirect'] = 'true' end [ status, headers, body ] end end
Version data entries
9 entries across 9 versions & 1 rubygems