Class: Rack::Async::Lint

Inherits:
Original::Lint
  • Object
show all
Defined in:
lib/rack/async/lint.rb

Instance Method Summary collapse

Instance Method Details

#_call(env) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/rack/async/lint.rb', line 10

def _call(env)
  status, *rest = catch(:async) { super } || ASYNC_RESPONSE
  assert "async response detected without the handler supporting async.callback" do
    status.to_i < 0 and not env.include?('async.callback')
  end
  [status, *rest]
end

#check_content_length(status, headers) ⇒ Object



8
# File 'lib/rack/async/lint.rb', line 8

def check_content_length(status, headers) super unless status.to_i < 0  end

#check_content_type(status, headers) ⇒ Object



7
# File 'lib/rack/async/lint.rb', line 7

def check_content_type(status, headers)   super unless status.to_i < 0  end

#check_status(status) ⇒ Object



6
# File 'lib/rack/async/lint.rb', line 6

def check_status(status)                  super unless status.to_i < 0  end