DEV: Fix another form of sending data in ember-cli (#15079)

This commit is contained in:
Jarek Radosz 2021-11-24 18:54:15 +01:00 committed by GitHub
parent 8fd10e6414
commit 9380c1273e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -317,16 +317,15 @@ to serve API requests. For example:
return true;
}
if (
request.get("Content-Type") &&
request.get("Content-Type").includes("application/x-www-form-urlencoded")
) {
return true;
const contentType = request.get("Content-Type");
if (!contentType) {
return false;
}
if (
request.get("Content-Type") &&
request.get("Content-Type").includes("multipart/form-data")
contentType.includes("application/x-www-form-urlencoded") ||
contentType.includes("multipart/form-data") ||
contentType.includes("application/json")
) {
return true;
}