From 0512452111a2a921d07dbde72639619ff63cf045 Mon Sep 17 00:00:00 2001 From: Andrea Spacca Date: Sun, 9 May 2021 09:21:54 +0200 Subject: [PATCH] Added UrlRandomToken in template data --- server/handlers.go | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/server/handlers.go b/server/handlers.go index 4c4d59e..39bf2b7 100644 --- a/server/handlers.go +++ b/server/handlers.go @@ -174,23 +174,25 @@ func (s *Server) previewHandler(w http.ResponseWriter, r *http.Request) { webAddress := resolveWebAddress(r, s.proxyPath, s.proxyPort) data := struct { - ContentType string - Content html_template.HTML - Filename string - Url string - UrlGet string - Hostname string - WebAddress string - ContentLength uint64 - GAKey string - UserVoiceKey string - QRCode string + ContentType string + Content html_template.HTML + Filename string + Url string + UrlGet string + UrlRandomToken string + Hostname string + WebAddress string + ContentLength uint64 + GAKey string + UserVoiceKey string + QRCode string }{ contentType, content, filename, resolvedURL, resolvedURLGet, + token, hostname, webAddress, contentLength, @@ -1007,7 +1009,6 @@ func (s *Server) getHandler(w http.ResponseWriter, r *http.Request) { w.Header().Set("X-Remaining-Downloads", remainingDownloads) w.Header().Set("X-Remaining-Days", remainingDays) - if disposition == "inline" && strings.Contains(contentType, "html") { reader = ioutil.NopCloser(bluemonday.UGCPolicy().SanitizeReader(reader)) }