weihanglo / sfz

A simple static file serving command-line tool written in Rust.
https://crates.io/crates/sfz
Apache License 2.0
400 stars 30 forks source link

Is it possible to set `charset` in content-type response header? #68

Closed ypyl closed 3 years ago

ypyl commented 3 years ago

Hello there, thanks for the great application. I am wondering if it is possible to set/add charset=utf-8 in Content-Type response header. Currently, I see the following type of text when I opening yaml file:

  workspace: # ❗ todo ❗

but it is working well if I am replacing (via chrome extension) response header from Content-Type: text/x-yaml to Content-Type: text/x-yaml; charset utf-8. Is it possible somehow to set up charset? thanks in advance for your help and support

weihanglo commented 3 years ago

Good catch! It reasonable and feasible to set UTF-8 as default.