Compare commits

...

3 commits

Author SHA1 Message Date
Casey Bodley
785596b9c6 Merge branch 'pr/177' into wip-176-177 2017-07-26 08:09:32 -04:00
Gaudenz Steinlin
d7504981b8 Upgrade requests to at least version 2.18.1
The redirection issue which was the reason to pin requests to a
specific version is fixed. At least the test failure on
s3tests.functional.test_s3.test_post_object_success_redirect_action
no longer occurs with version 2.18.1.

The new version solves the issue the old version has with newer versions
of libssl which disable SSLv3 support.

The currently pinned version of requests is from 2012 (!).
2017-07-24 19:37:36 +02:00
Gaudenz Steinlin
4b553b448a Fix CORS tests without Origin headers
According to the CORS spec 6.1.1 [1] requests without an Origin header
should not return any access-control-* headers. But the current test
method expects these headers to be always present in the response. Fix
this by defaulting to None if the header is not present.

[1] https://www.w3.org/TR/cors/#resource-requests
2017-07-24 15:52:11 +02:00
2 changed files with 3 additions and 3 deletions

View file

@ -5,7 +5,7 @@ bunch >=1.0.0
# 0.14 switches to libev, that means bootstrap needs to change too # 0.14 switches to libev, that means bootstrap needs to change too
gevent >=1.0 gevent >=1.0
isodate >=0.4.4 isodate >=0.4.4
requests ==0.14.0 requests >=2.18.1
pytz >=2011k pytz >=2011k
ordereddict ordereddict
httplib2 httplib2

View file

@ -5760,8 +5760,8 @@ def _cors_request_and_check(func, url, headers, expect_status, expect_allow_orig
r = func(url, headers=headers) r = func(url, headers=headers)
eq(r.status_code, expect_status) eq(r.status_code, expect_status)
assert r.headers['access-control-allow-origin'] == expect_allow_origin assert r.headers.get('access-control-allow-origin', None) == expect_allow_origin
assert r.headers['access-control-allow-methods'] == expect_allow_methods assert r.headers.get('access-control-allow-methods', None) == expect_allow_methods