Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Invalid mime type for serving css? #33

Open
jvanveen opened this issue Jul 18, 2024 · 1 comment
Open

Invalid mime type for serving css? #33

jvanveen opened this issue Jul 18, 2024 · 1 comment

Comments

@jvanveen
Copy link

It seems that a css file is returned with the incorrect mime type. Any idea what may be wrong?
image

@jvanveen
Copy link
Author

jvanveen commented Jul 18, 2024

As a workaround, I used:

    app.get('/public/*', ({set, params}) => {
        const file = Bun.file(`${import.meta.dir}/../public/${params['*']}`)
        set.headers['Content-Type'] = file.type
        return file.text()
    })

As being mentioned at elysiajs/elysia#524

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant