Skip to content

Commit c8be074

Browse files
committed
fix: normalize content-type header handling for charset parameters
- Use req.headers.get() for case-insensitive header access - Strip charset parameters before content-type comparison - Improves reliability when handling varied header formats
1 parent b98353c commit c8be074

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/adapters/vanilla.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ export async function requestFromVanilla(req: Request): Promise<OAuthRequest> {
3939
const headers: Record<string, unknown> = Object.fromEntries(req.headers);
4040

4141
let body: Record<string, unknown> = {};
42-
const contentType = headers['content-type'];
42+
const rawContentType = req.headers.get("content-type") || "";
43+
const contentType = rawContentType.split(";")[0].trim();
4344

4445
if (req.body) {
4546
if (contentType === "application/x-www-form-urlencoded") {

0 commit comments

Comments
 (0)