Skip to content
Snippets Groups Projects
Commit 67da6479 authored by Silke Hofstra's avatar Silke Hofstra
Browse files

Set default Content-Disposition of plain text media to 'inline'

parent 60fd79ce
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ...@@ -7,6 +7,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## [Unreleased] ## [Unreleased]
### Changed
* `Content-Disposition` of plain text files now defaults to `inline`.
## [1.2.4] - March 5th, 2021 ## [1.2.4] - March 5th, 2021
### Fixed ### Fixed
......
...@@ -192,7 +192,7 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { ...@@ -192,7 +192,7 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if result.ContentType == "" { if result.ContentType == "" {
disposition = "attachment" disposition = "attachment"
} else { } else {
if util.HasAnyPrefix(result.ContentType, []string{"image/", "audio/", "video/"}) { if util.HasAnyPrefix(result.ContentType, []string{"image/", "audio/", "video/", "text/plain"}) {
disposition = "inline" disposition = "inline"
} else { } else {
disposition = "attachment" disposition = "attachment"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment