diff --git a/services/service-steedos-server/index.js b/services/service-steedos-server/index.js index 5956831b4c..e37d8b34e5 100644 --- a/services/service-steedos-server/index.js +++ b/services/service-steedos-server/index.js @@ -216,6 +216,16 @@ module.exports = { }); connectHandlersExpress.use(require('@steedos/router').staticRouter()); connectHandlersExpress.use(SteedosApi.express()); + if(process.env.STEEDOS_HTTP_DISABLE_METHOD){ + WebApp.connectHandlers.use((req, res, next) => { + if (_.split(process.env.STEEDOS_HTTP_DISABLE_METHOD).includes(req.method)){ + res.statusCode = 405; + return res.end('Method Not Allowed') + } + return next() + }); + } + WebApp.connectHandlers.use(connectHandlersExpress) const steedosSchema = require('@steedos/objectql').getSteedosSchema(this.broker); this.wrapAsync(this.startStandardObjectsPackageLoader, {});