Sha256: 8b2ce75fda7d86fc048876a629ea32accb77940aa1c4ffe353fd74dd7629b616
Contents?: true
Size: 396 Bytes
Versions: 8
Compression:
Stored size: 396 Bytes
Contents
module Routemaster module Middleware # Rejects all requests but POST to the root path class RootPostOnly def initialize(app, _options = {}) @app = app end def call(env) return [404, {}, []] unless ['', '/'].include? env['PATH_INFO'] return [405, {}, []] if env['REQUEST_METHOD'] != 'POST' @app.call(env) end end end end
Version data entries
8 entries across 8 versions & 1 rubygems