nickel-org / nickel.rs

An expressjs inspired web framework for Rust

Home Page:http://nickel-org.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ability to disable mimetype-guessing for send_file

untitaker opened this issue · comments

The file has no file extension, but I know the mimetype.

Some ideas:

  • Use set_header_fallback inside send_file so I can set the header beforehand
  • Implement Responder for file objects, change send_file to build the mimetype guessing on top of that.

@untitaker The first suggestion sounds worth doing regardless, would you like to PR that change?

I've considered implementing Responder for File/Path before, but I can't remember what was iffy about that, it might be worth investigating again :)