mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2024-12-25 20:00:19 +01:00
Merge pull request #370 from dutchcoders/ISSUE-38-WEB
Added UrlRandomToken in template data
This commit is contained in:
commit
b5ffdb5095
1 changed files with 13 additions and 12 deletions
|
@ -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))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue