diff --git a/lib/lib/context.js b/lib/lib/context.js index 07ecba58..7276f6eb 100644 --- a/lib/lib/context.js +++ b/lib/lib/context.js @@ -108,6 +108,11 @@ async function contextMiddleware (context) { const response = await app.$typo3.api.getPage(path) const { data } = response + const contentType = response.headers['content-type'] + if (contentType && !contentType.includes('application/json')) { + return setErrorContext(context, { response: { status: 415, message: 'Unsupported content-type: \'application/json\' expected.' } }) + } + if (context.res) { setResponseHeaders(context, response.headers) }