1
0
Fork 0
mirror of synced 2024-07-05 06:20:55 +12:00

fix test failure

This commit is contained in:
Martin McKeaveney 2021-09-06 16:18:50 +01:00
parent 9e4ab9054e
commit 53aebdf585

View file

@ -5,13 +5,13 @@ const { buildMatcherRegex, matches } = require("./matchers")
module.exports = ( module.exports = (
allowQueryStringPatterns, allowQueryStringPatterns,
noTenancyPatterns, noTenancyPatterns,
{ noTenancyRequired } opts = {}
) => { ) => {
const allowQsOptions = buildMatcherRegex(allowQueryStringPatterns) const allowQsOptions = buildMatcherRegex(allowQueryStringPatterns)
const noTenancyOptions = buildMatcherRegex(noTenancyPatterns) const noTenancyOptions = buildMatcherRegex(noTenancyPatterns)
return ContextFactory.getMiddleware(ctx => { return ContextFactory.getMiddleware(ctx => {
const allowNoTenant = noTenancyRequired || !!matches(ctx, noTenancyOptions) const allowNoTenant = opts.noTenancyRequired || !!matches(ctx, noTenancyOptions)
const allowQs = !!matches(ctx, allowQsOptions) const allowQs = !!matches(ctx, allowQsOptions)
setTenantId(ctx, { allowQs, allowNoTenant }) setTenantId(ctx, { allowQs, allowNoTenant })
}) })