aboutsummaryrefslogtreecommitdiff
path: root/mediaapi
diff options
context:
space:
mode:
authorS7evinK <2353100+S7evinK@users.noreply.github.com>2022-03-04 12:03:51 +0100
committerGitHub <noreply@github.com>2022-03-04 12:03:51 +0100
commit5e694cd362ed21fa824f219cd0058fb57897e079 (patch)
tree36f31db5ffcffc1dd635962d1dc6ef0a4da6dcf4 /mediaapi
parent7fc62d8178bfc362231436746457d14c44d238ff (diff)
Un-ratelimit calls to /thumbnail (#2251)
Diffstat (limited to 'mediaapi')
-rw-r--r--mediaapi/routing/routing.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/mediaapi/routing/routing.go b/mediaapi/routing/routing.go
index fc2136bb..0e158399 100644
--- a/mediaapi/routing/routing.go
+++ b/mediaapi/routing/routing.go
@@ -120,13 +120,16 @@ func makeDownloadAPI(
w.Header().Set("Content-Type", "application/json")
// Ratelimit requests
- if r := rateLimits.Limit(req); r != nil {
- if err := json.NewEncoder(w).Encode(r); err != nil {
- w.WriteHeader(http.StatusInternalServerError)
+ // NOTSPEC: The spec says everything at /media/ should be rate limited, but this causes issues with thumbnails (#2243)
+ if name != "thumbnail" {
+ if r := rateLimits.Limit(req); r != nil {
+ if err := json.NewEncoder(w).Encode(r); err != nil {
+ w.WriteHeader(http.StatusInternalServerError)
+ return
+ }
+ w.WriteHeader(http.StatusTooManyRequests)
return
}
- w.WriteHeader(http.StatusTooManyRequests)
- return
}
vars, _ := httputil.URLDecodeMapValues(mux.Vars(req))