Skip to content
Myr

fix(method-override): handle Content-Type with charset parameter (#4894)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by mixelburg · committed by GitHub · parent f774f8d · Browse files · 2 files+18 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Co-authored-by: mast1ff <mast1ff@users.noreply.github.com>

Diff stats

2 files+18 added−1 removed

  • tests:+17 added−0 removed
  • other:+1 added−1 removed

2 files+18 added−1 removed

modified:src/middleware/method-override/index.test.ts+17 added
modified:src/middleware/method-override/index.ts+1 added-1 removed
87 unmodified lines
88 return app.fetch(request, c.env, getExecutionCtx(c))89 }90 }91 // Content-Type is `application/x-www-form-urlencoded`92 if (contentType === 'application/x-www-form-urlencoded') {92 if (contentType?.startsWith('application/x-www-form-urlencoded')) {93 const params = await parseBody<Record<string, string>>(clonedRequest)94 const method = params[methodFormName]95 if (method) {96 delete params[methodFormName]
50 unmodified lines