Skip to content

Commit

Permalink
revert edits
Browse files Browse the repository at this point in the history
  • Loading branch information
nevilleburnell authored and Tom Robinson committed Sep 19, 2009
1 parent b491a0d commit ee1bef3
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/jack/showstatus.js
Expand Up @@ -19,7 +19,7 @@ var escapeHTML = function(str) {
return str ? str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;") : "";
};

var ShowStatus = function(app) {
var ShowStatus = exports.ShowStatus = function(app) {
return function(env) {
var response = app(env);

Expand All @@ -28,27 +28,26 @@ var ShowStatus = function(app) {
var req = new Request(env);
var status = HTTP_STATUS_CODES[response.status] || String(response.status);

response.body = [
sprintf(template,
var body = sprintf(template,
escapeHTML(status),
escapeHTML(req.scriptName() + req.pathInfo()),
escapeHTML(status),
response.status,
escapeHTML(req.requestMethod()),
escapeHTML(req.uri()),
escapeHTML(env["rack.showstatus.detail"] || status)
)
];
);

response.body = [body];

HashP.set(response.headers, "Content-Type", "text/html");
HashP.set(response.headers, "Content-Length", String(body.toByteString().length));
}

return response;
}
};

exports.ShowStatus = require("jack").ContentLength(ShowStatus(app));

/*
template adapted from Django <djangoproject.com>
Copyright (c) 2005, the Lawrence Journal-World
Expand Down

0 comments on commit ee1bef3

Please sign in to comment.