unexport page

Former-commit-id: 1ba9608a9c
This commit is contained in:
Henrique Dias
2017-06-25 13:00:33 +01:00
parent 7b33975f7b
commit a4fe27a6d6
5 changed files with 98 additions and 108 deletions

View File

@@ -112,7 +112,7 @@ func (c *FileManager) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, er
// 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 {
return PrintErrorHTML(
return htmlError(
w, http.StatusForbidden,
errors.New("You don't have permission to access this page"),
)
@@ -134,7 +134,7 @@ func (c *FileManager) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, er
fi, err = GetInfo(r.URL, c, user)
if err != nil {
if r.Method == http.MethodGet {
return PrintErrorHTML(w, code, err)
return htmlError(w, code, err)
}
code = errorToHTTP(err, false)
return code, err
@@ -162,7 +162,7 @@ func (c *FileManager) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, er
}
if err != nil {
code, err = PrintErrorHTML(w, code, err)
code, err = htmlError(w, code, err)
}
return code, err