We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
pdf
ensureBlob
1 parent d683995 commit c6bddbbCopy full SHA for c6bddbb
src/runtime/blob/server/utils/blob.ts
@@ -717,7 +717,11 @@ export function ensureBlob(blob: Blob, options: BlobEnsureOptions = {}) {
717
}
718
719
const blobShortType = blob.type.split('/')[0]
720
- if (options.types?.length && !options.types.includes(blob.type as BlobType) && !options.types.includes(blobShortType as BlobType)) {
+ if (options.types?.length
721
+ && !options.types.includes(blob.type as BlobType)
722
+ && !options.types.includes(blobShortType as BlobType)
723
+ && !(options.types.includes('pdf' as BlobType) && blob.type === 'application/pdf')
724
+ ) {
725
throw createError({
726
statusCode: 400,
727
message: `File type is invalid, must be: ${options.types.join(', ')}`
0 commit comments