rack 1.6.13 → 2.1.4.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rack might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +92 -0
- data/{COPYING → MIT-LICENSE} +4 -2
- data/README.rdoc +105 -141
- data/Rakefile +27 -28
- data/SPEC +6 -7
- data/bin/rackup +1 -0
- data/contrib/rack_logo.svg +164 -111
- data/example/lobster.ru +2 -0
- data/example/protectedlobster.rb +4 -2
- data/example/protectedlobster.ru +3 -1
- data/lib/rack/auth/abstract/handler.rb +3 -1
- data/lib/rack/auth/abstract/request.rb +7 -1
- data/lib/rack/auth/basic.rb +4 -1
- data/lib/rack/auth/digest/md5.rb +9 -7
- data/lib/rack/auth/digest/nonce.rb +6 -3
- data/lib/rack/auth/digest/params.rb +5 -4
- data/lib/rack/auth/digest/request.rb +3 -1
- data/lib/rack/body_proxy.rb +11 -9
- data/lib/rack/builder.rb +42 -18
- data/lib/rack/cascade.rb +6 -5
- data/lib/rack/chunked.rb +33 -10
- data/lib/rack/{commonlogger.rb → common_logger.rb} +14 -10
- data/lib/rack/{conditionalget.rb → conditional_get.rb} +3 -1
- data/lib/rack/config.rb +2 -0
- data/lib/rack/content_length.rb +5 -3
- data/lib/rack/content_type.rb +3 -1
- data/lib/rack/core_ext/regexp.rb +14 -0
- data/lib/rack/deflater.rb +33 -53
- data/lib/rack/directory.rb +75 -60
- data/lib/rack/etag.rb +8 -5
- data/lib/rack/events.rb +156 -0
- data/lib/rack/file.rb +4 -149
- data/lib/rack/files.rb +178 -0
- data/lib/rack/handler/cgi.rb +18 -17
- data/lib/rack/handler/fastcgi.rb +17 -16
- data/lib/rack/handler/lsws.rb +14 -12
- data/lib/rack/handler/scgi.rb +22 -19
- data/lib/rack/handler/thin.rb +6 -1
- data/lib/rack/handler/webrick.rb +28 -28
- data/lib/rack/handler.rb +9 -26
- data/lib/rack/head.rb +17 -17
- data/lib/rack/lint.rb +55 -52
- data/lib/rack/lobster.rb +8 -6
- data/lib/rack/lock.rb +17 -10
- data/lib/rack/logger.rb +4 -2
- data/lib/rack/media_type.rb +43 -0
- data/lib/rack/{methodoverride.rb → method_override.rb} +10 -8
- data/lib/rack/mime.rb +27 -6
- data/lib/rack/mock.rb +101 -60
- data/lib/rack/multipart/generator.rb +11 -12
- data/lib/rack/multipart/parser.rb +292 -161
- data/lib/rack/multipart/uploaded_file.rb +3 -2
- data/lib/rack/multipart.rb +38 -8
- data/lib/rack/{nulllogger.rb → null_logger.rb} +3 -1
- data/lib/rack/query_parser.rb +218 -0
- data/lib/rack/recursive.rb +11 -9
- data/lib/rack/reloader.rb +10 -4
- data/lib/rack/request.rb +447 -305
- data/lib/rack/response.rb +196 -83
- data/lib/rack/rewindable_input.rb +5 -14
- data/lib/rack/runtime.rb +12 -18
- data/lib/rack/sendfile.rb +19 -14
- data/lib/rack/server.rb +118 -41
- data/lib/rack/session/abstract/id.rb +139 -94
- data/lib/rack/session/cookie.rb +34 -26
- data/lib/rack/session/memcache.rb +4 -93
- data/lib/rack/session/pool.rb +12 -10
- data/lib/rack/show_exceptions.rb +392 -0
- data/lib/rack/{showstatus.rb → show_status.rb} +7 -5
- data/lib/rack/static.rb +41 -11
- data/lib/rack/tempfile_reaper.rb +4 -2
- data/lib/rack/urlmap.rb +25 -15
- data/lib/rack/utils.rb +203 -277
- data/lib/rack.rb +76 -24
- data/rack.gemspec +25 -14
- metadata +62 -183
- data/HISTORY.md +0 -375
- data/KNOWN-ISSUES +0 -44
- data/lib/rack/backports/uri/common_18.rb +0 -56
- data/lib/rack/backports/uri/common_192.rb +0 -52
- data/lib/rack/backports/uri/common_193.rb +0 -29
- data/lib/rack/handler/evented_mongrel.rb +0 -8
- data/lib/rack/handler/mongrel.rb +0 -106
- data/lib/rack/handler/swiftiplied_mongrel.rb +0 -8
- data/lib/rack/showexceptions.rb +0 -387
- data/lib/rack/utils/okjson.rb +0 -600
- data/test/builder/anything.rb +0 -5
- data/test/builder/comment.ru +0 -4
- data/test/builder/end.ru +0 -5
- data/test/builder/line.ru +0 -1
- data/test/builder/options.ru +0 -2
- data/test/cgi/assets/folder/test.js +0 -1
- data/test/cgi/assets/fonts/font.eot +0 -1
- data/test/cgi/assets/images/image.png +0 -1
- data/test/cgi/assets/index.html +0 -1
- data/test/cgi/assets/javascripts/app.js +0 -1
- data/test/cgi/assets/stylesheets/app.css +0 -1
- data/test/cgi/lighttpd.conf +0 -26
- data/test/cgi/rackup_stub.rb +0 -6
- data/test/cgi/sample_rackup.ru +0 -5
- data/test/cgi/test +0 -9
- data/test/cgi/test+directory/test+file +0 -1
- data/test/cgi/test.fcgi +0 -8
- data/test/cgi/test.ru +0 -5
- data/test/gemloader.rb +0 -10
- data/test/multipart/bad_robots +0 -259
- data/test/multipart/binary +0 -0
- data/test/multipart/content_type_and_no_filename +0 -6
- data/test/multipart/empty +0 -10
- data/test/multipart/fail_16384_nofile +0 -814
- data/test/multipart/file1.txt +0 -1
- data/test/multipart/filename_and_modification_param +0 -7
- data/test/multipart/filename_and_no_name +0 -6
- data/test/multipart/filename_with_escaped_quotes +0 -6
- data/test/multipart/filename_with_escaped_quotes_and_modification_param +0 -7
- data/test/multipart/filename_with_null_byte +0 -7
- data/test/multipart/filename_with_percent_escaped_quotes +0 -6
- data/test/multipart/filename_with_unescaped_percentages +0 -6
- data/test/multipart/filename_with_unescaped_percentages2 +0 -6
- data/test/multipart/filename_with_unescaped_percentages3 +0 -6
- data/test/multipart/filename_with_unescaped_quotes +0 -6
- data/test/multipart/ie +0 -6
- data/test/multipart/invalid_character +0 -6
- data/test/multipart/mixed_files +0 -21
- data/test/multipart/nested +0 -10
- data/test/multipart/none +0 -9
- data/test/multipart/semicolon +0 -6
- data/test/multipart/text +0 -15
- data/test/multipart/three_files_three_fields +0 -31
- data/test/multipart/webkit +0 -32
- data/test/rackup/config.ru +0 -31
- data/test/registering_handler/rack/handler/registering_myself.rb +0 -8
- data/test/spec_auth_basic.rb +0 -81
- data/test/spec_auth_digest.rb +0 -259
- data/test/spec_body_proxy.rb +0 -85
- data/test/spec_builder.rb +0 -223
- data/test/spec_cascade.rb +0 -61
- data/test/spec_cgi.rb +0 -102
- data/test/spec_chunked.rb +0 -101
- data/test/spec_commonlogger.rb +0 -93
- data/test/spec_conditionalget.rb +0 -102
- data/test/spec_config.rb +0 -22
- data/test/spec_content_length.rb +0 -85
- data/test/spec_content_type.rb +0 -45
- data/test/spec_deflater.rb +0 -339
- data/test/spec_directory.rb +0 -88
- data/test/spec_etag.rb +0 -107
- data/test/spec_fastcgi.rb +0 -107
- data/test/spec_file.rb +0 -221
- data/test/spec_handler.rb +0 -72
- data/test/spec_head.rb +0 -45
- data/test/spec_lint.rb +0 -550
- data/test/spec_lobster.rb +0 -58
- data/test/spec_lock.rb +0 -164
- data/test/spec_logger.rb +0 -23
- data/test/spec_methodoverride.rb +0 -111
- data/test/spec_mime.rb +0 -51
- data/test/spec_mock.rb +0 -297
- data/test/spec_mongrel.rb +0 -182
- data/test/spec_multipart.rb +0 -600
- data/test/spec_nulllogger.rb +0 -20
- data/test/spec_recursive.rb +0 -72
- data/test/spec_request.rb +0 -1232
- data/test/spec_response.rb +0 -407
- data/test/spec_rewindable_input.rb +0 -118
- data/test/spec_runtime.rb +0 -49
- data/test/spec_sendfile.rb +0 -130
- data/test/spec_server.rb +0 -167
- data/test/spec_session_abstract_id.rb +0 -53
- data/test/spec_session_cookie.rb +0 -410
- data/test/spec_session_memcache.rb +0 -358
- data/test/spec_session_persisted_secure_secure_session_hash.rb +0 -73
- data/test/spec_session_pool.rb +0 -246
- data/test/spec_showexceptions.rb +0 -98
- data/test/spec_showstatus.rb +0 -103
- data/test/spec_static.rb +0 -145
- data/test/spec_tempfile_reaper.rb +0 -63
- data/test/spec_thin.rb +0 -91
- data/test/spec_urlmap.rb +0 -236
- data/test/spec_utils.rb +0 -647
- data/test/spec_version.rb +0 -17
- data/test/spec_webrick.rb +0 -184
- data/test/static/another/index.html +0 -1
- data/test/static/index.html +0 -1
- data/test/testrequest.rb +0 -78
- data/test/unregistered_handler/rack/handler/unregistered.rb +0 -7
- data/test/unregistered_handler/rack/handler/unregistered_long_one.rb +0 -7
data/lib/rack/showexceptions.rb
DELETED
@@ -1,387 +0,0 @@
|
|
1
|
-
require 'ostruct'
|
2
|
-
require 'erb'
|
3
|
-
require 'rack/request'
|
4
|
-
require 'rack/utils'
|
5
|
-
|
6
|
-
module Rack
|
7
|
-
# Rack::ShowExceptions catches all exceptions raised from the app it
|
8
|
-
# wraps. It shows a useful backtrace with the sourcefile and
|
9
|
-
# clickable context, the whole Rack environment and the request
|
10
|
-
# data.
|
11
|
-
#
|
12
|
-
# Be careful when you use this on public-facing sites as it could
|
13
|
-
# reveal information helpful to attackers.
|
14
|
-
|
15
|
-
class ShowExceptions
|
16
|
-
CONTEXT = 7
|
17
|
-
|
18
|
-
def initialize(app)
|
19
|
-
@app = app
|
20
|
-
@template = ERB.new(TEMPLATE)
|
21
|
-
end
|
22
|
-
|
23
|
-
def call(env)
|
24
|
-
@app.call(env)
|
25
|
-
rescue StandardError, LoadError, SyntaxError => e
|
26
|
-
exception_string = dump_exception(e)
|
27
|
-
|
28
|
-
env["rack.errors"].puts(exception_string)
|
29
|
-
env["rack.errors"].flush
|
30
|
-
|
31
|
-
if accepts_html?(env)
|
32
|
-
content_type = "text/html"
|
33
|
-
body = pretty(env, e)
|
34
|
-
else
|
35
|
-
content_type = "text/plain"
|
36
|
-
body = exception_string
|
37
|
-
end
|
38
|
-
|
39
|
-
[
|
40
|
-
500,
|
41
|
-
{
|
42
|
-
CONTENT_TYPE => content_type,
|
43
|
-
CONTENT_LENGTH => Rack::Utils.bytesize(body).to_s,
|
44
|
-
},
|
45
|
-
[body],
|
46
|
-
]
|
47
|
-
end
|
48
|
-
|
49
|
-
def prefers_plaintext?(env)
|
50
|
-
!accepts_html?(env)
|
51
|
-
end
|
52
|
-
|
53
|
-
def accepts_html?(env)
|
54
|
-
Rack::Utils.best_q_match(env["HTTP_ACCEPT"], %w[text/html])
|
55
|
-
end
|
56
|
-
private :accepts_html?
|
57
|
-
|
58
|
-
def dump_exception(exception)
|
59
|
-
string = "#{exception.class}: #{exception.message}\n"
|
60
|
-
string << exception.backtrace.map { |l| "\t#{l}" }.join("\n")
|
61
|
-
string
|
62
|
-
end
|
63
|
-
|
64
|
-
def pretty(env, exception)
|
65
|
-
req = Rack::Request.new(env)
|
66
|
-
|
67
|
-
# This double assignment is to prevent an "unused variable" warning on
|
68
|
-
# Ruby 1.9.3. Yes, it is dumb, but I don't like Ruby yelling at me.
|
69
|
-
path = path = (req.script_name + req.path_info).squeeze("/")
|
70
|
-
|
71
|
-
# This double assignment is to prevent an "unused variable" warning on
|
72
|
-
# Ruby 1.9.3. Yes, it is dumb, but I don't like Ruby yelling at me.
|
73
|
-
frames = frames = exception.backtrace.map { |line|
|
74
|
-
frame = OpenStruct.new
|
75
|
-
if line =~ /(.*?):(\d+)(:in `(.*)')?/
|
76
|
-
frame.filename = $1
|
77
|
-
frame.lineno = $2.to_i
|
78
|
-
frame.function = $4
|
79
|
-
|
80
|
-
begin
|
81
|
-
lineno = frame.lineno-1
|
82
|
-
lines = ::File.readlines(frame.filename)
|
83
|
-
frame.pre_context_lineno = [lineno-CONTEXT, 0].max
|
84
|
-
frame.pre_context = lines[frame.pre_context_lineno...lineno]
|
85
|
-
frame.context_line = lines[lineno].chomp
|
86
|
-
frame.post_context_lineno = [lineno+CONTEXT, lines.size].min
|
87
|
-
frame.post_context = lines[lineno+1..frame.post_context_lineno]
|
88
|
-
rescue
|
89
|
-
end
|
90
|
-
|
91
|
-
frame
|
92
|
-
else
|
93
|
-
nil
|
94
|
-
end
|
95
|
-
}.compact
|
96
|
-
|
97
|
-
@template.result(binding)
|
98
|
-
end
|
99
|
-
|
100
|
-
def h(obj) # :nodoc:
|
101
|
-
case obj
|
102
|
-
when String
|
103
|
-
Utils.escape_html(obj)
|
104
|
-
else
|
105
|
-
Utils.escape_html(obj.inspect)
|
106
|
-
end
|
107
|
-
end
|
108
|
-
|
109
|
-
# :stopdoc:
|
110
|
-
|
111
|
-
# adapted from Django <djangoproject.com>
|
112
|
-
# Copyright (c) 2005, the Lawrence Journal-World
|
113
|
-
# Used under the modified BSD license:
|
114
|
-
# http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5
|
115
|
-
TEMPLATE = <<'HTML'
|
116
|
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
117
|
-
<html lang="en">
|
118
|
-
<head>
|
119
|
-
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
120
|
-
<meta name="robots" content="NONE,NOARCHIVE" />
|
121
|
-
<title><%=h exception.class %> at <%=h path %></title>
|
122
|
-
<style type="text/css">
|
123
|
-
html * { padding:0; margin:0; }
|
124
|
-
body * { padding:10px 20px; }
|
125
|
-
body * * { padding:0; }
|
126
|
-
body { font:small sans-serif; }
|
127
|
-
body>div { border-bottom:1px solid #ddd; }
|
128
|
-
h1 { font-weight:normal; }
|
129
|
-
h2 { margin-bottom:.8em; }
|
130
|
-
h2 span { font-size:80%; color:#666; font-weight:normal; }
|
131
|
-
h3 { margin:1em 0 .5em 0; }
|
132
|
-
h4 { margin:0 0 .5em 0; font-weight: normal; }
|
133
|
-
table {
|
134
|
-
border:1px solid #ccc; border-collapse: collapse; background:white; }
|
135
|
-
tbody td, tbody th { vertical-align:top; padding:2px 3px; }
|
136
|
-
thead th {
|
137
|
-
padding:1px 6px 1px 3px; background:#fefefe; text-align:left;
|
138
|
-
font-weight:normal; font-size:11px; border:1px solid #ddd; }
|
139
|
-
tbody th { text-align:right; color:#666; padding-right:.5em; }
|
140
|
-
table.vars { margin:5px 0 2px 40px; }
|
141
|
-
table.vars td, table.req td { font-family:monospace; }
|
142
|
-
table td.code { width:100%;}
|
143
|
-
table td.code div { overflow:hidden; }
|
144
|
-
table.source th { color:#666; }
|
145
|
-
table.source td {
|
146
|
-
font-family:monospace; white-space:pre; border-bottom:1px solid #eee; }
|
147
|
-
ul.traceback { list-style-type:none; }
|
148
|
-
ul.traceback li.frame { margin-bottom:1em; }
|
149
|
-
div.context { margin: 10px 0; }
|
150
|
-
div.context ol {
|
151
|
-
padding-left:30px; margin:0 10px; list-style-position: inside; }
|
152
|
-
div.context ol li {
|
153
|
-
font-family:monospace; white-space:pre; color:#666; cursor:pointer; }
|
154
|
-
div.context ol.context-line li { color:black; background-color:#ccc; }
|
155
|
-
div.context ol.context-line li span { float: right; }
|
156
|
-
div.commands { margin-left: 40px; }
|
157
|
-
div.commands a { color:black; text-decoration:none; }
|
158
|
-
#summary { background: #ffc; }
|
159
|
-
#summary h2 { font-weight: normal; color: #666; }
|
160
|
-
#summary ul#quicklinks { list-style-type: none; margin-bottom: 2em; }
|
161
|
-
#summary ul#quicklinks li { float: left; padding: 0 1em; }
|
162
|
-
#summary ul#quicklinks>li+li { border-left: 1px #666 solid; }
|
163
|
-
#explanation { background:#eee; }
|
164
|
-
#template, #template-not-exist { background:#f6f6f6; }
|
165
|
-
#template-not-exist ul { margin: 0 0 0 20px; }
|
166
|
-
#traceback { background:#eee; }
|
167
|
-
#requestinfo { background:#f6f6f6; padding-left:120px; }
|
168
|
-
#summary table { border:none; background:transparent; }
|
169
|
-
#requestinfo h2, #requestinfo h3 { position:relative; margin-left:-100px; }
|
170
|
-
#requestinfo h3 { margin-bottom:-1em; }
|
171
|
-
.error { background: #ffc; }
|
172
|
-
.specific { color:#cc3300; font-weight:bold; }
|
173
|
-
</style>
|
174
|
-
<script type="text/javascript">
|
175
|
-
//<!--
|
176
|
-
function getElementsByClassName(oElm, strTagName, strClassName){
|
177
|
-
// Written by Jonathan Snook, http://www.snook.ca/jon;
|
178
|
-
// Add-ons by Robert Nyman, http://www.robertnyman.com
|
179
|
-
var arrElements = (strTagName == "*" && document.all)? document.all :
|
180
|
-
oElm.getElementsByTagName(strTagName);
|
181
|
-
var arrReturnElements = new Array();
|
182
|
-
strClassName = strClassName.replace(/\-/g, "\\-");
|
183
|
-
var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$$)");
|
184
|
-
var oElement;
|
185
|
-
for(var i=0; i<arrElements.length; i++){
|
186
|
-
oElement = arrElements[i];
|
187
|
-
if(oRegExp.test(oElement.className)){
|
188
|
-
arrReturnElements.push(oElement);
|
189
|
-
}
|
190
|
-
}
|
191
|
-
return (arrReturnElements)
|
192
|
-
}
|
193
|
-
function hideAll(elems) {
|
194
|
-
for (var e = 0; e < elems.length; e++) {
|
195
|
-
elems[e].style.display = 'none';
|
196
|
-
}
|
197
|
-
}
|
198
|
-
window.onload = function() {
|
199
|
-
hideAll(getElementsByClassName(document, 'table', 'vars'));
|
200
|
-
hideAll(getElementsByClassName(document, 'ol', 'pre-context'));
|
201
|
-
hideAll(getElementsByClassName(document, 'ol', 'post-context'));
|
202
|
-
}
|
203
|
-
function toggle() {
|
204
|
-
for (var i = 0; i < arguments.length; i++) {
|
205
|
-
var e = document.getElementById(arguments[i]);
|
206
|
-
if (e) {
|
207
|
-
e.style.display = e.style.display == 'none' ? 'block' : 'none';
|
208
|
-
}
|
209
|
-
}
|
210
|
-
return false;
|
211
|
-
}
|
212
|
-
function varToggle(link, id) {
|
213
|
-
toggle('v' + id);
|
214
|
-
var s = link.getElementsByTagName('span')[0];
|
215
|
-
var uarr = String.fromCharCode(0x25b6);
|
216
|
-
var darr = String.fromCharCode(0x25bc);
|
217
|
-
s.innerHTML = s.innerHTML == uarr ? darr : uarr;
|
218
|
-
return false;
|
219
|
-
}
|
220
|
-
//-->
|
221
|
-
</script>
|
222
|
-
</head>
|
223
|
-
<body>
|
224
|
-
|
225
|
-
<div id="summary">
|
226
|
-
<h1><%=h exception.class %> at <%=h path %></h1>
|
227
|
-
<h2><%=h exception.message %></h2>
|
228
|
-
<table><tr>
|
229
|
-
<th>Ruby</th>
|
230
|
-
<td>
|
231
|
-
<% if first = frames.first %>
|
232
|
-
<code><%=h first.filename %></code>: in <code><%=h first.function %></code>, line <%=h frames.first.lineno %>
|
233
|
-
<% else %>
|
234
|
-
unknown location
|
235
|
-
<% end %>
|
236
|
-
</td>
|
237
|
-
</tr><tr>
|
238
|
-
<th>Web</th>
|
239
|
-
<td><code><%=h req.request_method %> <%=h(req.host + path)%></code></td>
|
240
|
-
</tr></table>
|
241
|
-
|
242
|
-
<h3>Jump to:</h3>
|
243
|
-
<ul id="quicklinks">
|
244
|
-
<li><a href="#get-info">GET</a></li>
|
245
|
-
<li><a href="#post-info">POST</a></li>
|
246
|
-
<li><a href="#cookie-info">Cookies</a></li>
|
247
|
-
<li><a href="#env-info">ENV</a></li>
|
248
|
-
</ul>
|
249
|
-
</div>
|
250
|
-
|
251
|
-
<div id="traceback">
|
252
|
-
<h2>Traceback <span>(innermost first)</span></h2>
|
253
|
-
<ul class="traceback">
|
254
|
-
<% frames.each { |frame| %>
|
255
|
-
<li class="frame">
|
256
|
-
<code><%=h frame.filename %></code>: in <code><%=h frame.function %></code>
|
257
|
-
|
258
|
-
<% if frame.context_line %>
|
259
|
-
<div class="context" id="c<%=h frame.object_id %>">
|
260
|
-
<% if frame.pre_context %>
|
261
|
-
<ol start="<%=h frame.pre_context_lineno+1 %>" class="pre-context" id="pre<%=h frame.object_id %>">
|
262
|
-
<% frame.pre_context.each { |line| %>
|
263
|
-
<li onclick="toggle('pre<%=h frame.object_id %>', 'post<%=h frame.object_id %>')"><%=h line %></li>
|
264
|
-
<% } %>
|
265
|
-
</ol>
|
266
|
-
<% end %>
|
267
|
-
|
268
|
-
<ol start="<%=h frame.lineno %>" class="context-line">
|
269
|
-
<li onclick="toggle('pre<%=h frame.object_id %>', 'post<%=h frame.object_id %>')"><%=h frame.context_line %><span>...</span></li></ol>
|
270
|
-
|
271
|
-
<% if frame.post_context %>
|
272
|
-
<ol start='<%=h frame.lineno+1 %>' class="post-context" id="post<%=h frame.object_id %>">
|
273
|
-
<% frame.post_context.each { |line| %>
|
274
|
-
<li onclick="toggle('pre<%=h frame.object_id %>', 'post<%=h frame.object_id %>')"><%=h line %></li>
|
275
|
-
<% } %>
|
276
|
-
</ol>
|
277
|
-
<% end %>
|
278
|
-
</div>
|
279
|
-
<% end %>
|
280
|
-
</li>
|
281
|
-
<% } %>
|
282
|
-
</ul>
|
283
|
-
</div>
|
284
|
-
|
285
|
-
<div id="requestinfo">
|
286
|
-
<h2>Request information</h2>
|
287
|
-
|
288
|
-
<h3 id="get-info">GET</h3>
|
289
|
-
<% if req.GET and not req.GET.empty? %>
|
290
|
-
<table class="req">
|
291
|
-
<thead>
|
292
|
-
<tr>
|
293
|
-
<th>Variable</th>
|
294
|
-
<th>Value</th>
|
295
|
-
</tr>
|
296
|
-
</thead>
|
297
|
-
<tbody>
|
298
|
-
<% req.GET.sort_by { |k, v| k.to_s }.each { |key, val| %>
|
299
|
-
<tr>
|
300
|
-
<td><%=h key %></td>
|
301
|
-
<td class="code"><div><%=h val.inspect %></div></td>
|
302
|
-
</tr>
|
303
|
-
<% } %>
|
304
|
-
</tbody>
|
305
|
-
</table>
|
306
|
-
<% else %>
|
307
|
-
<p>No GET data.</p>
|
308
|
-
<% end %>
|
309
|
-
|
310
|
-
<h3 id="post-info">POST</h3>
|
311
|
-
<% if req.POST and not req.POST.empty? %>
|
312
|
-
<table class="req">
|
313
|
-
<thead>
|
314
|
-
<tr>
|
315
|
-
<th>Variable</th>
|
316
|
-
<th>Value</th>
|
317
|
-
</tr>
|
318
|
-
</thead>
|
319
|
-
<tbody>
|
320
|
-
<% req.POST.sort_by { |k, v| k.to_s }.each { |key, val| %>
|
321
|
-
<tr>
|
322
|
-
<td><%=h key %></td>
|
323
|
-
<td class="code"><div><%=h val.inspect %></div></td>
|
324
|
-
</tr>
|
325
|
-
<% } %>
|
326
|
-
</tbody>
|
327
|
-
</table>
|
328
|
-
<% else %>
|
329
|
-
<p>No POST data.</p>
|
330
|
-
<% end %>
|
331
|
-
|
332
|
-
|
333
|
-
<h3 id="cookie-info">COOKIES</h3>
|
334
|
-
<% unless req.cookies.empty? %>
|
335
|
-
<table class="req">
|
336
|
-
<thead>
|
337
|
-
<tr>
|
338
|
-
<th>Variable</th>
|
339
|
-
<th>Value</th>
|
340
|
-
</tr>
|
341
|
-
</thead>
|
342
|
-
<tbody>
|
343
|
-
<% req.cookies.each { |key, val| %>
|
344
|
-
<tr>
|
345
|
-
<td><%=h key %></td>
|
346
|
-
<td class="code"><div><%=h val.inspect %></div></td>
|
347
|
-
</tr>
|
348
|
-
<% } %>
|
349
|
-
</tbody>
|
350
|
-
</table>
|
351
|
-
<% else %>
|
352
|
-
<p>No cookie data.</p>
|
353
|
-
<% end %>
|
354
|
-
|
355
|
-
<h3 id="env-info">Rack ENV</h3>
|
356
|
-
<table class="req">
|
357
|
-
<thead>
|
358
|
-
<tr>
|
359
|
-
<th>Variable</th>
|
360
|
-
<th>Value</th>
|
361
|
-
</tr>
|
362
|
-
</thead>
|
363
|
-
<tbody>
|
364
|
-
<% env.sort_by { |k, v| k.to_s }.each { |key, val| %>
|
365
|
-
<tr>
|
366
|
-
<td><%=h key %></td>
|
367
|
-
<td class="code"><div><%=h val %></div></td>
|
368
|
-
</tr>
|
369
|
-
<% } %>
|
370
|
-
</tbody>
|
371
|
-
</table>
|
372
|
-
|
373
|
-
</div>
|
374
|
-
|
375
|
-
<div id="explanation">
|
376
|
-
<p>
|
377
|
-
You're seeing this error because you use <code>Rack::ShowExceptions</code>.
|
378
|
-
</p>
|
379
|
-
</div>
|
380
|
-
|
381
|
-
</body>
|
382
|
-
</html>
|
383
|
-
HTML
|
384
|
-
|
385
|
-
# :startdoc:
|
386
|
-
end
|
387
|
-
end
|