Merge "fix error with setting max age and incorrect tests"
This commit is contained in:
commit
217bd202dd
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user