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