Skip to content

Commit

Permalink
Render request variables panel values more readably using #inspect, a…
Browse files Browse the repository at this point in the history
…nd constrain very large values from blowing out the layout
  • Loading branch information
Luke Melia committed May 31, 2010
1 parent d7b4e5e commit 64c67f4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/rack/bug/panels/request_variables_panel.rb
Expand Up @@ -36,11 +36,11 @@ def split_and_filter_env(env)
server, rack = {}, {}
env.each do |k,v|
if k.index("rack.") == 0
rack[k] = v.to_s
rack[k] = v
elsif k.index("rack-bug.") == 0
#don't output the rack-bug variables - especially secret_key
else
server[k] = v.to_s
server[k] = v
end
end
return server, rack
Expand Down
5 changes: 5 additions & 0 deletions lib/rack/bug/public/__rack_bug__/bug.css
Expand Up @@ -209,3 +209,8 @@
#rack_bug #sql.panel_content th.actions {
width: 150px;
}
#rack_bug #request_variables td.code > div {
max-height:200px;
max-width: 800px;
overflow:auto;
}
4 changes: 2 additions & 2 deletions lib/rack/bug/views/panels/request_variables.html.erb
Expand Up @@ -2,7 +2,7 @@
next unless sections.has_key?(header)
%>
<h3><%=header%></h3>
<table>
<table id="request_variables">
<thead>
<tr>
<th>Variable</th>
Expand All @@ -14,7 +14,7 @@
<% sections[header].each do |key, val| %>
<tr class="<%= i % 2 == 0 ? "even" : "odd" %>">
<td><%=h key %></td>
<td class="code"><div><%=h val %></div></td>
<td class="code"><div><%=h val.inspect %></div></td>
</tr>
<% i += 1 %>
<% end %>
Expand Down

0 comments on commit 64c67f4

Please sign in to comment.