From 28ea0de82e083d5f6a11cf7fb2fbd2c1cc7e5ea9 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Wed, 2 Nov 2016 19:29:29 +0000 Subject: [PATCH] update --- _embed/public/js/application.js | 2 +- _embed/templates/actions.tmpl | 5 +++++ _embed/templates/base.tmpl | 30 +++++++++++------------------- filemanager.go | 8 ++++---- 4 files changed, 21 insertions(+), 24 deletions(-) diff --git a/_embed/public/js/application.js b/_embed/public/js/application.js index a3583d00..fa63bb00 100644 --- a/_embed/public/js/application.js +++ b/_embed/public/js/application.js @@ -922,4 +922,4 @@ document.addEventListener("DOMContentLoaded", function(event) { } return false; -}); \ No newline at end of file +}); diff --git a/_embed/templates/actions.tmpl b/_embed/templates/actions.tmpl index a42d11d1..7f3b2ef1 100644 --- a/_embed/templates/actions.tmpl +++ b/_embed/templates/actions.tmpl @@ -7,6 +7,11 @@ mode_edit {{ end }} + +{{ end }}
file_download Download diff --git a/_embed/templates/base.tmpl b/_embed/templates/base.tmpl index 1d45b405..195cb73a 100644 --- a/_embed/templates/base.tmpl +++ b/_embed/templates/base.tmpl @@ -93,31 +93,23 @@ {{ if .IsDir }}
-
-
- arrow_back -
-

- 0 - selected.

-
-
- {{ template "actions" . }} -
+
+
+ arrow_back +
+

0 selected.

+
+
+ {{ template "actions" . }} +
{{ end }}
- - {{ template "content" . }} + {{ template "content" . }}
-
+ diff --git a/filemanager.go b/filemanager.go index 9a64c276..ddd03586 100644 --- a/filemanager.go +++ b/filemanager.go @@ -43,10 +43,6 @@ func (f FileManager) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, err return f.Next.ServeHTTP(w, r) } - w.Header().Set("x-frame-options", "SAMEORIGIN") - w.Header().Set("x-content-type", "nosniff") - w.Header().Set("x-xss-protection", "1; mode=block") - c = &f.Configs[i] // Checks if the URL matches the Assets URL. Returns the asset if the @@ -96,6 +92,10 @@ func (f FileManager) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, err return 0, nil } + w.Header().Set("x-frame-options", "SAMEORIGIN") + w.Header().Set("x-content-type", "nosniff") + w.Header().Set("x-xss-protection", "1; mode=block") + // Checks if the User is allowed to access this file if !user.Allowed(strings.TrimPrefix(r.URL.Path, c.BaseURL)) { if r.Method == http.MethodGet {