Class: Rack::HttpTraceRejector
- Inherits:
-
Object
- Object
- Rack::HttpTraceRejector
- Defined in:
- lib/rack/http_trace_rejector.rb,
lib/rack/http_trace_rejector/version.rb
Constant Summary collapse
- VERSION =
"0.1.0"
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ HttpTraceRejector
constructor
A new instance of HttpTraceRejector.
Constructor Details
#initialize(app) ⇒ HttpTraceRejector
Returns a new instance of HttpTraceRejector.
7 8 9 |
# File 'lib/rack/http_trace_rejector.rb', line 7 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 15 |
# File 'lib/rack/http_trace_rejector.rb', line 11 def call(env) req = Rack::Request.new(env) return [405, {}, []] if req.request_method == "TRACE" @app.call(env) end |