fix #60: clamp expires_in on cans API (400 on zero/negative, cap 1yr)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user