pope (owner)

Revisions

gist: 211109 Download_button fork
public
Public Clone URL: git://gist.github.com/211109.git
Embed All Files: show embed
rack-foxnews.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'rack'
 
module Rack
 
  class FoxNews
    
    PATH_INFO = "/fox-news".freeze
 
    def initialize(app)
      @app = app
    end
 
    def call(env)
      if env.path_info == PATH_INFO
        ["204 No Content", {"Content-Type" => "text/html", "Content-Length" => "0"}, []]
      else
        @app.call(env)
      end
    end
 
  end
  
end