Class: Rack::SockJS::MissingHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/sockjs.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ MissingHandler

Returns a new instance of MissingHandler.



73
74
# File 'lib/rack/sockjs.rb', line 73

def initialize(options)
end

Instance Method Details

#call(env) ⇒ Object



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/rack/sockjs.rb', line 76

def call(env)
  prefix = env["PATH_INFO"]
  method = env["REQUEST_METHOD"]
  body = <<-HTML
    <!DOCTYPE html>
    <html>
      <body>
        <h1>Handler Not Found</h1>
        <ul>
          <li>Prefix: #{prefix.inspect}</li>
          <li>Method: #{method.inspect}</li>
        </ul>
      </body>
    </html>
  HTML
  ::SockJS.debug "Handler not found!"
  [404, {"Content-Type" => "text/html; charset=UTF-8", "Content-Length" => body.bytesize.to_s}, [body]]
end