Skip to content

Commit 8f8b090

Browse files
authored
fix(oidc-mock-provider): allow optional charset in content-type (#553)
1 parent 8209e74 commit 8f8b090

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/oidc-mock-provider/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ export class OIDCMockProvider {
148148
if (req.method === 'POST') {
149149
// For simplicity, just merge POST parameters with GET parameters...
150150
if (
151-
req.headers['content-type'] !== 'application/x-www-form-urlencoded'
151+
!/^application\/x-www-form-urlencoded(;charset=utf-?8)?$/i.test(
152+
req.headers['content-type'] ?? '',
153+
)
152154
) {
153155
throw new Error(
154156
'Only accepting application/x-www-form-urlencoded POST bodies',

0 commit comments

Comments
 (0)