mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 14:25:17 +00:00
Added content-type check
This commit is contained in:
@@ -58,6 +58,14 @@ declare global {
|
||||
|
||||
export const pass = functions.https.onRequest(
|
||||
async (request: RequestWithBody, response) => {
|
||||
if (request.headers["content-type"] !== "application/json") {
|
||||
response.status(400);
|
||||
response.send({
|
||||
error: `Payload with content-type ${request.headers["content-type"]} is not supported. Use "application/json"`,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!request.body.passModel) {
|
||||
response.status(400);
|
||||
response.send({
|
||||
|
||||
Reference in New Issue
Block a user