mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-07-10 00:14:38 +00:00
Serve shipped markdown docs as text instead of a forced download
The embedded frontend file server had no content type for .md, so every in-app "Full details" / "Terms of Service" / security-guide link to /docs/*.md answered application/octet-stream and the browser downloaded the file instead of showing it. Shipped docs now serve as text/plain; charset=utf-8 and open readable in the tab the app targets.
This commit is contained in:
parent
54a6118d17
commit
07fb7dbbac
1 changed files with 5 additions and 0 deletions
|
|
@ -262,6 +262,11 @@ func serveFrontendHandler() http.HandlerFunc {
|
|||
contentType = "application/json"
|
||||
} else if strings.HasSuffix(lookupPath, ".svg") {
|
||||
contentType = "image/svg+xml"
|
||||
} else if strings.HasSuffix(lookupPath, ".md") {
|
||||
// Shipped docs (/docs/*.md) open in a browser tab from
|
||||
// in-app links; text/plain renders them readable instead
|
||||
// of forcing a download.
|
||||
contentType = "text/plain; charset=utf-8"
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", contentType)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue