mirror of
https://github.com/wekan/wekan.git
synced 2026-03-09 07:02:34 +01:00
Fix checking if API is enabled
This commit is contained in:
parent
cf9ad221f8
commit
7a60eef375
1 changed files with 2 additions and 2 deletions
|
|
@ -946,8 +946,8 @@ if (Meteor.isServer) {
|
||||||
if (Meteor.isServer) {
|
if (Meteor.isServer) {
|
||||||
// Middleware which checks that API is enabled.
|
// Middleware which checks that API is enabled.
|
||||||
JsonRoutes.Middleware.use(function(req, res, next) {
|
JsonRoutes.Middleware.use(function(req, res, next) {
|
||||||
const api = req.url.search('api');
|
const api = req.url.startsWith('/api');
|
||||||
if ((api === 1 && process.env.WITH_API === 'true') || api === -1) {
|
if ((api === true && process.env.WITH_API === 'true') || api === false) {
|
||||||
return next();
|
return next();
|
||||||
} else {
|
} else {
|
||||||
res.writeHead(301, { Location: '/' });
|
res.writeHead(301, { Location: '/' });
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue