mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2024-12-26 04:10:18 +01:00
commit
3ed153904d
1 changed files with 2 additions and 2 deletions
|
@ -383,7 +383,7 @@ type Metadata struct {
|
||||||
|
|
||||||
func MetadataForRequest(contentType string, r *http.Request) Metadata {
|
func MetadataForRequest(contentType string, r *http.Request) Metadata {
|
||||||
metadata := Metadata{
|
metadata := Metadata{
|
||||||
ContentType: contentType,
|
ContentType: strings.ToLower(contentType),
|
||||||
MaxDate: time.Time{},
|
MaxDate: time.Time{},
|
||||||
Downloads: 0,
|
Downloads: 0,
|
||||||
MaxDownloads: -1,
|
MaxDownloads: -1,
|
||||||
|
@ -1010,7 +1010,7 @@ func (s *Server) getHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Set("X-Remaining-Days", remainingDays)
|
w.Header().Set("X-Remaining-Days", remainingDays)
|
||||||
|
|
||||||
|
|
||||||
if strings.Contains(contentType, "html") {
|
if disposition == "inline" && strings.Contains(contentType, "html") {
|
||||||
reader = ioutil.NopCloser(
|
reader = ioutil.NopCloser(
|
||||||
bytes.NewReader(
|
bytes.NewReader(
|
||||||
bluemonday.UGCPolicy().
|
bluemonday.UGCPolicy().
|
||||||
|
|
Loading…
Reference in a new issue