Skip to content

Instantly share code, notes, and snippets.

@mikestone14
Last active August 29, 2015 14:02
Show Gist options
  • Save mikestone14/9721f8aebbb64cdadb2a to your computer and use it in GitHub Desktop.
Save mikestone14/9721f8aebbb64cdadb2a to your computer and use it in GitHub Desktop.

using current_session and viewing the @headers hash

Rails 3: headers

@headers=
  {"HTTP_X_FORWARDED_FOR"=>"192.168.0.1",
   "HTTP_USER_AGENT"=>
    "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.308.0 Safari/532.9"},

@headers=
  {"HTTP_X_FORWARDED_FOR"=>"192.168.0.1",
   "HTTP_USER_AGENT"=>
    "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.308.0 Safari/532.9"},

@headers={},

@headers={},

@headers=
  {"HTTP_X_FORWARDED_FOR"=>"192.168.0.1",
   "HTTP_USER_AGENT"=>
    "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.308.0 Safari/532.9"},

@headers={},

@headers={},

@headers={},

@headers={},

@headers={},

@headers={},

Rails 4: headers 1)

@headers=
  {"HTTP_X_FORWARDED_FOR"=>"192.168.0.1",
   "HTTP_USER_AGENT"=>
    "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.308.0 Safari/532.9"},

@headers=
  {"HTTP_X_FORWARDED_FOR"=>"192.168.0.1",
   "HTTP_USER_AGENT"=>
    "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.308.0 Safari/532.9"},

@headers={},

  1. ERROR
@headers={},

@headers=
  {"HTTP_X_FORWARDED_FOR"=>"192.168.0.1",
   "HTTP_USER_AGENT"=>
    "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.308.0 Safari/532.9"},

@headers={},

  1. ERROR
@headers={"Accept-Celebration-Events"=>"all"},

  1. ERROR
@headers={},

  1. ERROR
@headers={},

  1. ERROR
@headers={},

@headers={},

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