Skip to content

Commit

Permalink
fix(validator): support multipart headers without a space separating …
Browse files Browse the repository at this point in the history
…boundary (#3286)
  • Loading branch information
Ernxst authored Aug 17, 2024
1 parent a5b2382 commit 81a1f07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/validator/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export type ValidationFunction<
type ExcludeResponseType<T> = T extends Response & TypedResponse<any> ? never : T

const jsonRegex = /^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/
const multipartRegex = /^multipart\/form-data(; boundary=[a-zA-Z0-9'"()+_,\-./:=?]+)?$/
const multipartRegex = /^multipart\/form-data(;\s?boundary=[a-zA-Z0-9'"()+_,\-./:=?]+)?$/
const urlencodedRegex = /^application\/x-www-form-urlencoded$/

export const validator = <
Expand Down

0 comments on commit 81a1f07

Please sign in to comment.