Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,7 @@ Server.prototype = new function () {
)
);

if (request.method != 'HEAD' && request.method != 'GET') {
// I don't know how to do this.
response.writeHead(405, {
'allow': 'HEAD, GET'
, 'content-type': 'text/plain; charset=utf-8'
});
response.write("405: Only the HEAD or GET methods are allowed.");
response.end();
} else if (!modulePath) {
if (!modulePath) {
if (next) {
next();
} else {
Expand All @@ -236,6 +228,14 @@ Server.prototype = new function () {
response.write("404: The requested resource could not be found.");
response.end();
}
} else if (request.method != 'HEAD' && request.method != 'GET') {
// I don't know how to do this.
response.writeHead(405, {
'allow': 'HEAD, GET'
, 'content-type': 'text/plain; charset=utf-8'
});
response.write("405: Only the HEAD or GET methods are allowed.");
response.end();
} else if (!('callback' in url.query)) {
// I respond with a straight-forward proxy.
var resourceURI = this._resourceURIForModulePath(modulePath);
Expand Down