mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-11-16 07:17:21 +00:00
Minor tweaks for #3362
This commit is contained in:
@@ -196,10 +196,9 @@ Server.prototype.requestHandler = function(request,response) {
|
||||
response.end();
|
||||
return;
|
||||
}
|
||||
|
||||
//receive the request body if necessary and hand off to the route handler
|
||||
// Receive the request body if necessary and hand off to the route handler
|
||||
if(route.bodyFormat === "stream" || request.method === "GET" || request.method === "HEAD") {
|
||||
//let the route handle the request stream itself
|
||||
// Let the route handle the request stream itself
|
||||
route.handler(request,response,state);
|
||||
} else if(route.bodyFormat === "string" || !route.bodyFormat) {
|
||||
// Set the encoding for the incoming request
|
||||
@@ -222,7 +221,8 @@ Server.prototype.requestHandler = function(request,response) {
|
||||
route.handler(request,response,state);
|
||||
})
|
||||
} else {
|
||||
throw "Invalid bodyFormat " + route.bodyFormat + " in route " + route.method + " " + route.path.source;
|
||||
response.writeHead(400,"Invalid bodyFormat " + route.bodyFormat + " in route " + route.method + " " + route.path.source);
|
||||
response.end();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user