Last active
January 30, 2020 22:50
-
-
Save charlespeach/fa7af677104e75ab94dbc06fb76c60cd to your computer and use it in GitHub Desktop.
Revisions
-
charlespeach renamed this gist
Jan 30, 2020 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,9 @@ `lib/reject_trace.rb` ```ruby module Rack class RejectTrace def initialize(app) @app = app end @@ -26,5 +26,5 @@ end ```ruby config.autoload_paths += %W(#{config.root}/lib) config.middleware.use "RejectTrace" ``` -
charlespeach revised this gist
Jan 30, 2020 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ `lib/reject_track.rb` ```ruby module Rack @@ -22,6 +22,8 @@ module Rack end ``` `config/application.rb` ```ruby config.autoload_paths += %W(#{config.root}/lib) config.middleware.use "RejectTrack" -
charlespeach created this gist
Jan 30, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ `/lib/reject_track.rb` ```ruby module Rack class RejectTrack def initialize(app) @app = app end def call(env) status, headers, body = @app.call(env) if env["REQUEST_METHOD"] == "TRACE" body.close if body.respond_to? :close [status, headers, []] else [status, headers, body] end end end end ``` ```ruby config.autoload_paths += %W(#{config.root}/lib) config.middleware.use "RejectTrack" ```