feat: better caching headers for images

This commit is contained in:
2026-03-09 13:35:23 +01:00
parent a27b4a66e6
commit 2b07701762
11 changed files with 83 additions and 43 deletions
+24
View File
@@ -0,0 +1,24 @@
package rest
import (
"fmt"
"net/http"
"strconv"
)
func IntParam(r *http.Request, key string) (val int, err error) {
str := r.URL.Query().Get(key)
if str == "" {
return
}
val, err = strconv.Atoi(str)
if err != nil {
err = WrappErr(
err,
ErrorTypeValidation,
fmt.Sprintf("failed to parse query parameter '%s': not an int", key),
)
}
return
}