mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-29 01:33:10 -06:00
Don't send multiple headers
This commit is contained in:
parent
5fccb3c1a0
commit
028ddebc00
|
|
@ -125,11 +125,11 @@ func makeDownloadAPI(
|
||||||
|
|
||||||
// Ratelimit requests
|
// Ratelimit requests
|
||||||
if r := rateLimits.Limit(req); r != nil {
|
if r := rateLimits.Limit(req); r != nil {
|
||||||
rw := json.NewEncoder(w)
|
if err := json.NewEncoder(w).Encode(r); err != nil {
|
||||||
w.WriteHeader(http.StatusTooManyRequests)
|
|
||||||
if err := rw.Encode(r); err != nil {
|
|
||||||
w.WriteHeader(http.StatusInternalServerError)
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
w.WriteHeader(http.StatusTooManyRequests)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue