Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

merge tide-compress's mime db stuff into the Content-Type typed header #504

Open
Fishrock123 opened this issue Jun 21, 2022 · 4 comments
Open
Labels
enhancement New feature or request HTTP Header Tracking issue for a structured HTTP header

Comments

@Fishrock123
Copy link
Member

basically, this but with the other fields that the json database provides: https://github.com/Fishrock123/tide-compress/blob/main/build.rs

see https://github.com/jshttp/mime-db/blob/master/db.json

@Fishrock123 Fishrock123 added the enhancement New feature or request label Jun 21, 2022
@Fishrock123
Copy link
Member Author

@yoshuawuyts I think static file serving should probably also use this to attempt to determine mime type before sniffing

@Fishrock123 Fishrock123 added the HTTP Header Tracking issue for a structured HTTP header label Jun 21, 2022
@yoshuawuyts
Copy link
Member

Oh yeah, this would be great! @Fishrock123 is this something you'd be able to contribute?

I'm thinking ideally we could move this from a build.rs script into a standalone command 1 which we can run periodically instead of every time someone builds. Some systems intentionally lock down external network connection during building; but in general pre-building it / checking it into the repo should be faster for most builds. But no worries if we start with a build.rs script and then refactor it later.

Footnotes

  1. I'm a big fan of the matklad/cargo-xtask pattern for this. That would allow us to do something like cargo xtask codegen in the repo to generate all the code we need.

@Fishrock123
Copy link
Member Author

I think a first step would be to do what you described in tide-compress then.

Fishrock123 added a commit to Fishrock123/tide-compress that referenced this issue Jul 31, 2022
@Fishrock123
Copy link
Member Author

That's now been done in tide-compress: Fishrock123/tide-compress@cc1551b

I did not use xtask as that seemed like it added more unnecessary stuff, I just made a run-able subcrate which isn't publishable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request HTTP Header Tracking issue for a structured HTTP header
Projects
None yet
Development

No branches or pull requests

2 participants