Linter configuration fixes and linting issues fixes.

Fixes #17.
This commit is contained in:
2020-02-29 22:41:06 +05:00
parent 11897d0e1a
commit 47672c586d
6 changed files with 17 additions and 9 deletions

View File

@@ -232,7 +232,7 @@ func pastePasswordedVerifyGet(ec echo.Context) error {
func pastePasswordedVerifyPost(ec echo.Context) error {
// We should check if database connection available.
dbConn := c.Database.GetDatabaseConnection()
// nolint
if c.Config.Database.Type != "flatfiles" && dbConn == nil {
return ec.Redirect(http.StatusFound, "/database_not_available")
}

View File

@@ -48,9 +48,9 @@ func pastePOSTWebInterface(ec echo.Context) error {
return ec.HTML(http.StatusBadRequest, errtpl)
}
// nolint
if !strings.ContainsAny(params["paste-keep-for"][0], "Mmhd") && params["paste-keep-for"][0] != "forever" {
c.Logger.Debug().Str("field value", params["paste-keep-for"][0]).Msg("'Keep paste for' field have invalid value")
errtpl := templater.GetErrorTemplate(ec, "Invalid 'Paste should be available for' parameter passed. Please do not try to hack us ;).")
return ec.HTML(http.StatusBadRequest, errtpl)