Skip to content

Instantly share code, notes, and snippets.

@fallwith
Created January 28, 2011 20:41
Show Gist options
  • Star 16 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fallwith/800906 to your computer and use it in GitHub Desktop.
Save fallwith/800906 to your computer and use it in GitHub Desktop.
Rails controller code to dump raw HTTP headers from a request
logger.warn "*** BEGIN RAW REQUEST HEADERS ***"
self.request.env.each do |header|
logger.warn "HEADER KEY: #{header[0]}"
logger.warn "HEADER VAL: #{header[1]}"
end
logger.warn "*** END RAW REQUEST HEADERS ***"
@dklotz
Copy link

dklotz commented May 16, 2018

@neilsy The HTTP_ prefix gets added for all request headers by rails / rack AFAIK, it does not come from the actual client request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment