Un-ratelimit calls to /thumbnail (#2251)
This commit is contained in:
parent
7fc62d8178
commit
5e694cd362
|
@ -120,6 +120,8 @@ func makeDownloadAPI(
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
|
||||||
// Ratelimit requests
|
// 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 r := rateLimits.Limit(req); r != nil {
|
||||||
if err := json.NewEncoder(w).Encode(r); err != nil {
|
if err := json.NewEncoder(w).Encode(r); err != nil {
|
||||||
w.WriteHeader(http.StatusInternalServerError)
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
@ -128,6 +130,7 @@ func makeDownloadAPI(
|
||||||
w.WriteHeader(http.StatusTooManyRequests)
|
w.WriteHeader(http.StatusTooManyRequests)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
vars, _ := httputil.URLDecodeMapValues(mux.Vars(req))
|
vars, _ := httputil.URLDecodeMapValues(mux.Vars(req))
|
||||||
serverName := gomatrixserverlib.ServerName(vars["serverName"])
|
serverName := gomatrixserverlib.ServerName(vars["serverName"])
|
||||||
|
|
Loading…
Reference in a new issue