Comparing version 0.0.7 to 0.0.8
@@ -8,2 +8,3 @@ | ||
var config = require('otto-config'); | ||
var errors = require('otto-errors'); | ||
var response = require('otto-response'); | ||
@@ -31,4 +32,13 @@ | ||
// Ensure res.locals exists | ||
// Remove Header X-Powered-By | ||
app.disable('x-powered-by'); | ||
// Ensure Content-Type is set | ||
app.use(function (req, res, next) { | ||
if (!req.headers['content-type']) { return next(new errors.ErrorBadRequest('Header Content-Type is required')); } | ||
next(); | ||
}); | ||
// Ensure req.locals exists | ||
app.use(function (req, res, next) { | ||
if (!req.locals) { req.locals = {}; } | ||
@@ -35,0 +45,0 @@ next(); |
{ | ||
"name" : "otto-app", | ||
"version" : "0.0.7", | ||
"version" : "0.0.8", | ||
"repository" : "https://github.com/ottojs/otto-app.git", | ||
@@ -10,2 +10,3 @@ "main" : "./lib/index.js", | ||
"otto-config" : "0.0.4", | ||
"otto-errors" : "0.0.2", | ||
"otto-response" : "0.1.0" | ||
@@ -12,0 +13,0 @@ }, |
5132
69
5
+ Addedotto-errors@0.0.2