aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework
diff options
context:
space:
mode:
Diffstat (limited to 'rest_framework')
-rw-r--r--rest_framework/exceptions.py2
-rw-r--r--rest_framework/views.py1
2 files changed, 2 insertions, 1 deletions
diff --git a/rest_framework/exceptions.py b/rest_framework/exceptions.py
index 97dab77e..ad52d172 100644
--- a/rest_framework/exceptions.py
+++ b/rest_framework/exceptions.py
@@ -72,7 +72,7 @@ class UnsupportedMediaType(APIException):
class Throttled(APIException):
status_code = status.HTTP_429_TOO_MANY_REQUESTS
default_detail = 'Request was throttled.'
- extra_detail = "Expected available in %d second%s."
+ extra_detail = " Expected available in %d second%s."
def __init__(self, wait=None, detail=None):
if wait is None:
diff --git a/rest_framework/views.py b/rest_framework/views.py
index bca0aaef..23df3443 100644
--- a/rest_framework/views.py
+++ b/rest_framework/views.py
@@ -62,6 +62,7 @@ def exception_handler(exc):
headers['WWW-Authenticate'] = exc.auth_header
if getattr(exc, 'wait', None):
headers['X-Throttle-Wait-Seconds'] = '%d' % exc.wait
+ headers['Retry-After'] = '%d' % exc.wait
return Response({'detail': exc.detail},
status=exc.status_code,