Open Huliiiiii opened 1 week ago
No response
This is how we check for file extensions: https://github.com/elysiajs/elysia/blob/90071866076617de1693c0edd50e62b6aa7f763b/src/type-system.ts#L207-L227
But we have wildcard file types: https://github.com/elysiajs/elysia/blob/90071866076617de1693c0edd50e62b6aa7f763b/src/type-system.ts#L103-L157
If we use wildcards in the extension, type checking will always fail:
function check(options, type) { if (options.extension) if (typeof options.extension === "string") { if (!type.startsWith(options.extension)) return false } else { for (let i = 0; i < options.extension.length; i++) if (type.startsWith(options.extension[i])) return true return false } } check({ extension: ["image/*"] }, "image/jpeg") // false check({ extension: ["image/*"] }, "image/png") // false
Is this intentional?
node_modules
bun.lockb
@Huliiiiii Already done https://github.com/elysiajs/elysia/pull/877
What version of Elysia is running?
No response
What platform is your computer?
No response
What steps can reproduce the bug?
This is how we check for file extensions: https://github.com/elysiajs/elysia/blob/90071866076617de1693c0edd50e62b6aa7f763b/src/type-system.ts#L207-L227
But we have wildcard file types: https://github.com/elysiajs/elysia/blob/90071866076617de1693c0edd50e62b6aa7f763b/src/type-system.ts#L103-L157
If we use wildcards in the extension, type checking will always fail:
Is this intentional?
What is the expected behavior?
No response
What do you see instead?
No response
Additional information
No response
Have you try removing the
node_modules
andbun.lockb
and try again yet?No response