Skip to content

Commit

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

async function userNodeMiddleware (req, res, 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()
}
// Disable all UM specific filtering
return next()
}

module.exports = { userNodeMiddleware }

0 comments on commit 8356c0a

Please sign in to comment.