salvo-rs / salvo

A powerful web framework built with a simplified design.
https://salvo.rs
Apache License 2.0
3.26k stars 197 forks source link

Provide ability to setup Content-Type for each file or type in StaticDir #881

Closed longzou closed 3 weeks ago

longzou commented 4 weeks ago

In many scenarios, we need to manually specify the Content Type and Content Disposal headers based on file type or file name.

chrislearn commented 4 weeks ago

See the handler-hoop branch. My thought is that it is difficult to have a very good way to have fine-grained control over individual files in a directory. Allowing hoop to be added directly to the Handler gives control to the user.