fix #60: clamp expires_in on cans API (400 on zero/negative, cap 1yr)

This commit is contained in:
2026-09-09 09:13:21 -05:00
parent 03bf327f6b
commit f611cc3e9e
2 changed files with 46 additions and 3 deletions
+1 -3
View File
@@ -1,11 +1,11 @@
package api
import (
"palette/internal/store"
"encoding/json"
"fmt"
"io"
"net/http"
"palette/internal/store"
"strings"
"time"
@@ -143,8 +143,6 @@ func detectContentType(name string, content []byte) string {
return "text/plain"
}
func (a *apiServer) handleGetCan(w http.ResponseWriter, r *http.Request) {
id := chi.URLParam(r, "id")
can, err := a.store.GetCan(id)