Fix for tests when headers are undefined
This commit is contained in:
parent
8a9e110929
commit
7546c1a8d5
|
@ -68,7 +68,7 @@ module.exports = async (ctx, next) => {
|
||||||
const isBuilder =
|
const isBuilder =
|
||||||
globalUser && globalUser.builder && globalUser.builder.global
|
globalUser && globalUser.builder && globalUser.builder.global
|
||||||
const isDevApp = appId && isDevAppID(appId)
|
const isDevApp = appId && isDevAppID(appId)
|
||||||
const roleHeader = ctx.request.headers[Headers.PREVIEW_ROLE]
|
const roleHeader = ctx.request && ctx.request.headers[Headers.PREVIEW_ROLE]
|
||||||
if (isBuilder && isDevApp && roleHeader) {
|
if (isBuilder && isDevApp && roleHeader) {
|
||||||
// Ensure the role is valid by ensuring a definition exists
|
// Ensure the role is valid by ensuring a definition exists
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue