0

I am writing own middleware for Goliath server.

How can I get request headers in "call" method?

Thanks!

Falcon
  • 1,461
  • 3
  • 15
  • 29

1 Answers1

1

"call" method always return [status_code, headers, body] tuple, see example below:

class AwesomeMiddleware
  include Goliath::Rack::AsyncMiddleware

  def call(env)
    status, headers, response = super(env)
    [status, headers, response]
  end

end

Also checkout AsyncMiddleware and SimpleAroundwareFactory in Goliath repository.

kkdoo
  • 11
  • 2