Check for empty content-type header.
This commit is contained in:
@@ -88,7 +88,7 @@ export async function getClientInfo(req, { screen }) {
|
||||
}
|
||||
|
||||
export function getJsonBody(req) {
|
||||
if (req.headers['content-type'].indexOf('text/plain') !== -1) {
|
||||
if ((req.headers['content-type'] || '').indexOf('text/plain') !== -1) {
|
||||
return JSON.parse(req.body);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user