cmd/stepd: Get content-type information from front matter

This commit is contained in:
Sasha Koshka 2024-12-06 02:01:10 -05:00
parent 5b88d13052
commit ed1cdf4e89

View File

@ -81,9 +81,8 @@ func (this *handler) serveFile (res http.ResponseWriter, req *http.Request, file
this.serveError(res, req, http.StatusInternalServerError, err)
return
}
if document.ContentType != "" {
log.Println(document.ContentType)
res.Header().Set("Content-Type", document.ContentType)
if contentType, ok := document.FrontMatter["content-type"]; ok {
res.Header().Set("Content-Type", contentType)
}
data := step.HTTPData { }
data.Res.Header = make(http.Header)