fix header check

This commit is contained in:
2025-01-18 12:25:11 +00:00
parent ad752a580b
commit f835545283
+3 -3
View File
@@ -77,11 +77,11 @@ async function validate(request, env) {
*/ */
async function oauth2(request, env) { async function oauth2(request, env) {
if (url.pathname !== '/oauth2/token') { if (url.pathname !== '/oauth2/token') {
return newResponse(null, { status: 400 }) return newResponse(null, { status: 404 })
} }
if (request.headers.get('content-type')!='multipart/form-data'){ if (!request.headers.get('content-type').includes('form')){
return newResponse(null, { status: 400 }) return newResponse(null, { status: 400, statusText:'content type must be form data' })
} }
const requestBody = await request.formData() const requestBody = await request.formData()