http-rs / http-types

Common types for HTTP operations

Home Page:https://docs.rs/http-types

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Fishrock123 opened this issue · comments

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

commented

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.

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

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.