sockmonk
sockmonk

Reputation: 4255

How can I show the headers received by Rack, and how Rails sees them?

I'm trying to debug an issue with Rails not showing the right IP, and I'd like to know how to show the headers that Rack receives from nginx, and how Rails sees them after they've been processed by all the rack middleware. Is there a straightforward way to do this within the context of a Rails 4.2.x application?

Upvotes: 1

Views: 795

Answers (1)

Richard Peck
Richard Peck

Reputation: 76774

You'll be able to use the request.headers:

#controller action
request.headers.each do |header|
    header
end

Upvotes: 1

Related Questions