Class: Rack::ErrorsOK

Inherits:
Object show all
Defined in:
lib/kiss/rack/errors_ok.rb

Overview

Rack::Facebook formats HTTP responses to remove certain status codes and HTML entities that are invalid as FBML responses.

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ ErrorsOK

Returns a new instance of ErrorsOK.



5
6
7
# File 'lib/kiss/rack/errors_ok.rb', line 5

def initialize(app)
  @_app = app
end

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/kiss/rack/errors_ok.rb', line 9

def call(env)
  code, headers, body = @_app.call(env)
  
  if code >= 500 && code < 600
    code = 200
  end
  
  [ code, headers, body ]
end