Skip to content

Commit

Permalink
upstream header fixes (#1301)
Browse files Browse the repository at this point in the history
  • Loading branch information
thehesiod authored Feb 25, 2025
1 parent 7cb07f6 commit 3e55d33
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 24 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
tags:
- >-
[0-9]+.[0-9]+.[0-9]+
- >-
[0-9]+.[0-9]+.[0-9]+.dev[0-9]+
pull_request:
branches:
- master
Expand Down
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Changes
-------
2.20.1.dev0 (2025-02-24)
^^^^^^^^^^^^^^^^^^^^^^^^
* upstream http response header fixes to be more in-line with botocore

2.20.0 (2025-02-19)
^^^^^^^^^^^^^^^^^^^
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ cov cover coverage: pre-commit

mototest:
python -Wd -X tracemalloc=5 -X faulthandler -m pytest -vv -m "not localonly" -n auto --cov-report term --cov-report html --cov-report xml --cov=aiobotocore --cov=tests --log-cli-level=DEBUG $(FLAGS) aiobotocore tests
@echo "open file://`pwd`/htmlcov/index.html"

clean:
rm -rf `find . -name __pycache__`
Expand Down
2 changes: 1 addition & 1 deletion aiobotocore/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.20.0'
__version__ = '2.20.1.dev0'
12 changes: 1 addition & 11 deletions aiobotocore/endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
logger,
)
from botocore.hooks import first_non_none_response
from urllib3.response import HTTPHeaderDict

from aiobotocore.httpchecksum import handle_checksum_body
from aiobotocore.httpsession import AIOHTTPSession
Expand All @@ -39,16 +38,7 @@ async def convert_to_response_dict(http_response, operation_model):
"""
response_dict = {
# botocore converts keys to str, so make sure that they are in
# the expected case. See detailed discussion here:
# https://github.com/aio-libs/aiobotocore/pull/116
# aiohttp's CIMultiDict camel cases the headers :(
'headers': HTTPHeaderDict(
{
k.decode('utf-8').lower(): v.decode('utf-8')
for k, v in http_response.raw.raw_headers
}
),
'headers': http_response.headers,
'status_code': http_response.status_code,
'context': {
'operation_name': operation_model.name,
Expand Down
11 changes: 10 additions & 1 deletion aiobotocore/httpsession.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,17 @@ async def send(self, request):
proxy_headers=proxy_headers,
)

# botocore converts keys to str, so make sure that they are in
# the expected case. See detailed discussion here:
# https://github.com/aio-libs/aiobotocore/pull/116
# aiohttp's CIMultiDict camel cases the headers :(
headers = {
k.decode('utf-8').lower(): v.decode('utf-8')
for k, v in response.raw_headers
}

http_response = aiobotocore.awsrequest.AioAWSResponse(
str(response.url), response.status, response.headers, response
str(response.url), response.status, headers, response
)

if not request.stream_output:
Expand Down
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ dependencies = [
"python-dateutil >= 2.1, < 3.0.0",
"jmespath >= 0.7.1, < 2.0.0",
"multidict >= 6.0.0, < 7.0.0",
"urllib3 >= 1.25.4, < 1.27; python_version < '3.10'",
"urllib3 >= 1.25.4, != 2.2.0, < 3; python_version >= '3.10'",
"wrapt >= 1.10.10, < 2.0.0",
]

Expand Down
4 changes: 0 additions & 4 deletions tests/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,6 @@ def test_release_versions():
# rst_ver.is_prerelease
# ), 'Version must be prerelease if final release date not set'
else:
assert (
not rst_ver.is_prerelease
), 'Version must not be prerelease if release date set'

rst_date = datetime.strptime(rst_date, '%Y-%m-%d').date()
rst_prev_date = datetime.strptime(rst_prev_date, '%Y-%m-%d').date()

Expand Down
4 changes: 0 additions & 4 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3e55d33

Please sign in to comment.