Skip to content

Commit

Permalink
Revert "[AUD-417] Update UM mode for promotion (#1300)" (#1309)
Browse files Browse the repository at this point in the history
This reverts commit 8356c0a.
  • Loading branch information
hareeshnagaraj committed Mar 16, 2021
1 parent 8356c0a commit f461037
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions creator-node/src/userNodeMiddleware.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
const { sendResponse, errorResponseUnauthorized } = require('./apiHelpers')
const config = require('./config')

async function userNodeMiddleware (req, res, next) {
// Disable all UM specific filtering
return next()
const isUserMetadataNode = config.get('isUserMetadataNode')
const userNodeRegex = new RegExp(/(users|version|db_check|health_check|image_upload|ipfs|export)/gm)
if (isUserMetadataNode) {
const isValidUrl = userNodeRegex.test(req.url)
if (!isValidUrl) {
return sendResponse(req, res, errorResponseUnauthorized('Invalid route for user metadata node'))
}
next()
} else {
next()
}
}

module.exports = { userNodeMiddleware }

0 comments on commit f461037

Please sign in to comment.