maintain (logging): improve some log message

This commit is contained in:
Mickael Kerjean 2022-09-28 21:23:29 +10:00
parent e8968d824a
commit 7a76f7dcda
2 changed files with 2 additions and 1 deletions

View file

@ -110,7 +110,7 @@ func SessionAuthenticate(ctx *App, res http.ResponseWriter, req *http.Request) {
c.Secure = true
c.SameSite = http.SameSiteNoneMode
if f := req.Header.Get("Referer"); f != "" && strings.HasPrefix(f, "https://") == false {
Log.Warning("iframe from non secure origin isn't supported '%s'", f)
Log.Warning("you are trying to access Filestash from a non secure origin ('%s') and with iframe enabled. Either use SSL or disable iframe from the admin console.", f)
}
}
http.SetCookie(res, c)

View file

@ -287,6 +287,7 @@ func _extractSession(req *http.Request, ctx *App) (map[string]string, error) {
str, err = DecryptString(SECRET_KEY_DERIVATE_FOR_USER, str)
if err != nil {
// This typically happen when changing the secret key
Log.Debug("middleware::session decrypt error '%s'", err.Error())
return session, nil
}
if err = json.Unmarshal([]byte(str), &session); err != nil {