From f835545283b7ed7e42aeec62b9fe0cc0e6070409 Mon Sep 17 00:00:00 2001 From: sugoidogo Date: Sat, 18 Jan 2025 12:25:11 +0000 Subject: [PATCH] fix header check --- src/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 69716ca..b06449b 100644 --- a/src/index.js +++ b/src/index.js @@ -77,11 +77,11 @@ async function validate(request, env) { */ async function oauth2(request, env) { if (url.pathname !== '/oauth2/token') { - return newResponse(null, { status: 400 }) + return newResponse(null, { status: 404 }) } - if (request.headers.get('content-type')!='multipart/form-data'){ - return newResponse(null, { status: 400 }) + if (!request.headers.get('content-type').includes('form')){ + return newResponse(null, { status: 400, statusText:'content type must be form data' }) } const requestBody = await request.formData()