correct minor webserver issues

This commit is contained in:
Amolith 2023-10-29 10:49:02 -04:00
parent 984d44775b
commit 61c24da28a
Signed by: Amolith
GPG Key ID: 8AE30347CE28D101
1 changed files with 2 additions and 4 deletions

View File

@ -99,9 +99,7 @@ func (h Handler) NewHandler(w http.ResponseWriter, r *http.Request) {
Forge: forge,
}
if strings.HasSuffix(proj.URL, ".git") {
proj.URL = proj.URL[:len(proj.URL)-4]
}
proj.URL = strings.TrimSuffix(proj.URL, ".git")
proj, err := project.GetReleases(h.DbConn, proj)
if err != nil {
@ -226,7 +224,7 @@ func (h Handler) LoginHandler(w http.ResponseWriter, r *http.Request) {
return
}
maxAge := int(expiry.Sub(time.Now()).Seconds())
maxAge := int(time.Until(expiry))
cookie := http.Cookie{
Name: "id",