Last active
December 29, 2015 08:49
-
-
Save webapprentice/7646269 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- depends on gems: sinatra/rack and useragent --> | |
<style> | |
th { | |
white-space: nowrap; | |
text-align: left; | |
vertical-align: baseline; | |
font-weight: normal; | |
color: darkred; | |
} | |
</style> | |
<table> | |
<tr><th>URL</th><td><%= request.url %></td></tr> | |
<tr><th>Params</th><td> | |
<% request.params.keys.each do |key| %> | |
<%= key %> : <%= request.params[key] %><br/> | |
<% end %> | |
</td></tr> | |
<tr><th>Request Method</th><td><%= request.request_method %></td></tr> | |
<tr><th>Referrer</th><td><%= request.referrer %></td></tr> | |
<tr><th> </th><td> </td></tr> | |
<tr><th>Scheme</th><td><%= request.scheme %></td></tr> | |
<tr><th>Host</th><td><%= request.host %></td></tr> | |
<tr><th>Port</th><td><%= request.port %></td></tr> | |
<tr><th>Path</th><td><%= request.path %></td></tr> | |
<tr><th>Query String</th><td><%= request.query_string %></td></tr> | |
<tr><th> </th><td> </td></tr> | |
<% ip_url = "http://www.ipchecking.com/?check=Lookup&ip=#{request.ip}" %> | |
<tr><th>IP Address</th><td><a href="<%= ip_url %>"><%= request.ip %></a></td></tr> | |
<tr><th> </th><td> </td></tr> | |
<tr><th>User Agent</th><td><%= request.user_agent %></td></tr> | |
<% user_agent = UserAgent.parse(request.user_agent) %> | |
<tr><th>Browser</th><td><%= user_agent.browser %></td></tr> | |
<tr><th>Version</th><td><%= user_agent.version %></td></tr> | |
<tr><th>Platform</th><td><%= user_agent.platform %></td></tr> | |
<tr><th> </th><td> </td></tr> | |
<tr><th>Cookies</th> | |
<td> | |
<% request.cookies.keys.each do |key| %> | |
<%= key %> : <%= request.cookies[key] %><br/> | |
<% end %> | |
</td></tr> | |
<tr><th> </th><td> </td></tr> | |
<tr><th>Accept</th><td><%= request.accept.join(', ') %></td></tr> | |
<tr><th>Accept Encoding</th><td> | |
<% request.accept_encoding.each do |encoding| %> | |
<%= encoding[0] %>, <%= encoding[1] %><br> | |
<% end %> | |
</td></tr> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment