Request headers in Goliath middleware

282 views Asked by At

I am writing own middleware for Goliath server.

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

Thanks!

1

There are 1 answers

0
kkdoo On

"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.