Mercurial > p > roundup > code
diff roundup/rest.py @ 5937:5d0873a4de4a
fix rate limit headers - were ints/floats need to be strings
Running under gunicorn rest requests were crashing. Not all of the
values for the rate limit headers were strings. Some were
numbers. This caused the header generation for wsgi to fail. Now the
values are all strings.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 20 Oct 2019 20:56:56 -0400 |
| parents | 3ca3bfe6de16 |
| children | 25a813415d59 |
line wrap: on
line diff
--- a/roundup/rest.py Sat Oct 19 20:19:43 2019 -0400 +++ b/roundup/rest.py Sun Oct 20 20:56:56 2019 -0400 @@ -1778,7 +1778,7 @@ # User exceeded limits: tell humans how long to wait # Headers above will do the right thing for api # aware clients. - msg=_("Api rate limits exceeded. Please wait: %d seconds.")%limitStatus['Retry-After'] + msg=_("Api rate limits exceeded. Please wait: %s seconds.")%limitStatus['Retry-After'] output = self.error_obj(429, msg, source="ApiRateLimiter") else: for header,value in limitStatus.items():
