fix error with setting max age and incorrect tests
Change-Id: I3f0db3b70ea5df323597b556682c2d1fb28afe53
This commit is contained in:
2 changed files with 6 additions and 6 deletions
@@ -728,8 +728,8 @@ class Controller(object):
resp.status = HTTP_UNAUTHORIZED
return resp # CORS preflight request that isn't valid
headers['access-control-allow-origin'] = req_origin_value
if cors.get('max_age', None) is not None:
headers['access-control-max-age'] = '%d' % cors.get('max_age')
if cors.get('max_age') is not None:
headers['access-control-max-age'] = cors.get('max_age')
headers['access-control-allow-methods'] = ', '.join(
self.allowed_methods)
if cors.get('allow_headers'):
@@ -3535,7 +3535,7 @@ class TestObjectController(unittest.TestCase):
'cors': {
'allow_origin': 'http://foo.bar:8080 https://foo.bar',
'allow_headers': 'x-foo',
'max_age': 999,
'max_age': '999',
}
}
controller.container_info = my_container_info
@@ -3595,7 +3595,7 @@ class TestObjectController(unittest.TestCase):
'cors': {
'allow_origin': '*',
'allow_headers': 'x-foo',
'max_age': 999,
'max_age': '999',
}
}
controller.container_info = my_container_info_wildcard
@@ -4141,7 +4141,7 @@ class TestContainerController(unittest.TestCase):
'cors': {
'allow_origin': 'http://foo.bar:8080 https://foo.bar',
'allow_headers': 'x-foo',
'max_age': 999,
'max_age': '999',
}
}
controller.container_info = my_container_info
@@ -4202,7 +4202,7 @@ class TestContainerController(unittest.TestCase):
'cors': {
'allow_origin': '*',
'allow_headers': 'x-foo',
'max_age': 999,
'max_age': '999',
}
}
controller.container_info = my_container_info_wildcard
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.