Fix bug 856664 overLimit errors now return 413
Added personal email to .mailmap to allow merge Change-Id: Ic9595b9b00cc6a388550ea558a5748c326f91736
This commit is contained in:
parent
637cd313cf
commit
e15258def2
1
.mailmap
1
.mailmap
@ -57,3 +57,4 @@
|
||||
<reldan@oscloud.ru> <enugaev@griddynamics.com>
|
||||
<kshileev@gmail.com> <kshileev@griddynamics.com>
|
||||
<nsokolov@griddynamics.com> <nsokolov@griddynamics.net>
|
||||
<troy.toman@rackspace.com> <ttcl@mac.com>
|
||||
|
@ -87,7 +87,7 @@ class OverLimitFault(webob.exc.HTTPException):
|
||||
"""
|
||||
Initialize new `OverLimitFault` with relevant information.
|
||||
"""
|
||||
self.wrapped_exc = webob.exc.HTTPForbidden()
|
||||
self.wrapped_exc = webob.exc.HTTPRequestEntityTooLarge()
|
||||
self.content = {
|
||||
"overLimitFault": {
|
||||
"code": self.wrapped_exc.status_int,
|
||||
|
@ -439,14 +439,14 @@ class LimitMiddlewareTest(BaseLimitTestSuite):
|
||||
self.assertEqual(200, response.status_int)
|
||||
|
||||
def test_limited_request_json(self):
|
||||
"""Test a rate-limited (403) GET request through middleware."""
|
||||
"""Test a rate-limited (413) GET request through middleware."""
|
||||
request = webob.Request.blank("/")
|
||||
response = request.get_response(self.app)
|
||||
self.assertEqual(200, response.status_int)
|
||||
|
||||
request = webob.Request.blank("/")
|
||||
response = request.get_response(self.app)
|
||||
self.assertEqual(response.status_int, 403)
|
||||
self.assertEqual(response.status_int, 413)
|
||||
|
||||
body = json.loads(response.body)
|
||||
expected = "Only 1 GET request(s) can be made to * every minute."
|
||||
@ -454,7 +454,7 @@ class LimitMiddlewareTest(BaseLimitTestSuite):
|
||||
self.assertEqual(value, expected)
|
||||
|
||||
def test_limited_request_xml(self):
|
||||
"""Test a rate-limited (403) response as XML"""
|
||||
"""Test a rate-limited (413) response as XML"""
|
||||
request = webob.Request.blank("/")
|
||||
response = request.get_response(self.app)
|
||||
self.assertEqual(200, response.status_int)
|
||||
@ -462,7 +462,7 @@ class LimitMiddlewareTest(BaseLimitTestSuite):
|
||||
request = webob.Request.blank("/")
|
||||
request.accept = "application/xml"
|
||||
response = request.get_response(self.app)
|
||||
self.assertEqual(response.status_int, 403)
|
||||
self.assertEqual(response.status_int, 413)
|
||||
|
||||
root = minidom.parseString(response.body).childNodes[0]
|
||||
expected = "Only 1 GET request(s) can be made to * every minute."
|
||||
|
Loading…
Reference in New Issue
Block a user