Un-ratelimit calls to /thumbnail

This commit is contained in:
Till Faelligen 2022-03-04 11:38:40 +01:00
parent f75169c353
commit cd09798549

View file

@ -120,6 +120,8 @@ func makeDownloadAPI(
w.Header().Set("Content-Type", "application/json")
// Ratelimit requests
// 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)
@ -128,6 +130,7 @@ func makeDownloadAPI(
w.WriteHeader(http.StatusTooManyRequests)
return
}
}
vars, _ := httputil.URLDecodeMapValues(mux.Vars(req))
serverName := gomatrixserverlib.ServerName(vars["serverName"])