diff --git a/.changes/1.43.115.json b/.changes/1.43.115.json
new file mode 100644
index 000000000..b63cb9f7f
--- /dev/null
+++ b/.changes/1.43.115.json
@@ -0,0 +1,17 @@
+[
+ {
+ "category": "``rekognition``",
+ "description": "Update rekognition client to latest version",
+ "type": "api-change"
+ },
+ {
+ "category": "HTTP",
+ "description": "Fixes a regression with urllib3 v2 where truncated response bodies read in chunks raised ``ResponseStreamingError`` before botocore could validate ``Content-Length``. These reads now raise ``IncompleteReadError`` again.",
+ "type": "bugfix"
+ },
+ {
+ "category": "SigV4",
+ "description": "Add W3C ``traceparent``, ``tracestate`` and ``baggage`` headers to the list of headers excluded from SigV4 signing.",
+ "type": "enhancement"
+ }
+]
\ No newline at end of file
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index eb7e6777b..f62e1dd1d 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -20,7 +20,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
- rev: a56c0b927e6465d37cae3e97d35d4d18ab2b96cd # frozen: v0.16.9
+ rev: f12be1ebaa5351c1fc76472de98db2c3446c8253 # frozen: v0.16.10
hooks:
- id: ruff-check
args: [ --fix ]
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 6610ed688..1a9f0e0ee 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -2,6 +2,14 @@
CHANGELOG
=========
+1.43.115
+========
+
+* api-change:``rekognition``: Update rekognition client to latest version
+* bugfix:HTTP: Fixes a regression with urllib3 v2 where truncated response bodies read in chunks raised ``ResponseStreamingError`` before botocore could validate ``Content-Length``. These reads now raise ``IncompleteReadError`` again.
+* enhancement:SigV4: Add W3C ``traceparent``, ``tracestate`` and ``baggage`` headers to the list of headers excluded from SigV4 signing.
+
+
1.43.114
========
diff --git a/botocore/__init__.py b/botocore/__init__.py
index 7d4ad5096..fb0efcb30 100644
--- a/botocore/__init__.py
+++ b/botocore/__init__.py
@@ -17,7 +17,7 @@ import os
import re
from logging import NullHandler
-__version__ = '1.43.114'
+__version__ = '1.43.115'
# Configure default logger to do nothing
diff --git a/botocore/auth.py b/botocore/auth.py
index 82408b255..18fb421ef 100644
--- a/botocore/auth.py
+++ b/botocore/auth.py
@@ -62,12 +62,15 @@ PAYLOAD_BUFFER = 1024 * 1024
ISO8601 = '%Y-%m-%dT%H:%M:%SZ'
SIGV4_TIMESTAMP = '%Y%m%dT%H%M%SZ'
SIGNED_HEADERS_BLACKLIST = [
+ 'baggage',
'connection',
'expect',
'keep-alive',
'proxy-authenticate',
'proxy-authorization',
'te',
+ 'traceparent',
+ 'tracestate',
'trailer',
'transfer-encoding',
'upgrade',
diff --git a/botocore/data/rekognition/2016-06-27/service-2.json b/botocore/data/rekognition/2016-06-27/service-2.json
index ced3a32d2..6456ecad7 100644
--- a/botocore/data/rekognition/2016-06-27/service-2.json
+++ b/botocore/data/rekognition/2016-06-27/service-2.json
@@ -4,8 +4,11 @@
"apiVersion":"2016-06-27",
"endpointPrefix":"rekognition",
"jsonVersion":"1.1",
- "protocol":"json",
- "protocols":["json"],
+ "protocol":"smithy-rpc-v2-cbor",
+ "protocols":[
+ "smithy-rpc-v2-cbor",
+ "json"
+ ],
"serviceFullName":"Amazon Rekognition",
"serviceId":"Rekognition",
"signatureVersion":"v4",
@@ -4785,6 +4788,7 @@
}
},
"documentation":"<p>The number of in-progress human reviews you have has exceeded the number allowed.</p>",
+ "error":{"httpStatusCode":402},
"exception":true
},
"IdempotentParameterMismatchException":{
diff --git a/botocore/httpsession.py b/botocore/httpsession.py
index 0286e9829..f14183674 100644
--- a/botocore/httpsession.py
+++ b/botocore/httpsession.py
@@ -516,6 +516,7 @@ class URLLib3Session:
preload_content=False,
decode_content=False,
chunked=self._chunked(request.headers),
+ enforce_content_length=False,
**extra_kwargs,
)
diff --git a/docs/source/conf.py b/docs/source/conf.py
index b132914e6..76ba891f4 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -59,7 +59,7 @@ copyright = f'{current_year}, Amazon Web Services, Inc'
# The short X.Y version.
version = '1.43.1'
# The full version, including alpha/beta/rc tags.
-release = '1.43.114'
+release = '1.43.115'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/tests/integration/test_client_http.py b/tests/integration/test_client_http.py
index 7a2b3d94b..81387ca7c 100644
--- a/tests/integration/test_client_http.py
+++ b/tests/integration/test_client_http.py
@@ -13,6 +13,7 @@ from botocore.exceptions import (
ConnectionClosedError,
ConnectTimeoutError,
EndpointConnectionError,
+ IncompleteReadError,
ProxyConnectionError,
ReadTimeoutError,
)
@@ -194,6 +195,29 @@ class TestClientHTTPBehavior(unittest.TestCase):
BadStatusHandler.event.wait(timeout=60)
client.describe_regions()
+ def test_truncated_body_raises_incomplete_read(self):
+ config = Config(retries={'max_attempts': 0}, region_name='us-weast-2')
+ client = self.session.create_client(
+ 's3', endpoint_url=self.localhost, config=config
+ )
+
+ class TruncatedHandler(SimpleHandler):
+ event = threading.Event()
+ msg = b'a' * 10
+
+ def get_length(self):
+ return len(self.msg) * 2
+
+ def get_body(self):
+ return self.msg
+
+ with background(run_server, args=(TruncatedHandler, self.port)):
+ TruncatedHandler.event.wait(timeout=60)
+ body = client.get_object(Bucket='foo', Key='bar')['Body']
+ with self.assertRaises(IncompleteReadError):
+ while body.read(5):
+ pass
+
def unused_port():
with contextlib.closing(socket.socket()) as sock:
diff --git a/tests/unit/auth/test_signers.py b/tests/unit/auth/test_signers.py
index 24307329a..e7318429b 100644
--- a/tests/unit/auth/test_signers.py
+++ b/tests/unit/auth/test_signers.py
@@ -432,6 +432,18 @@ class TestS3SigV4Auth(BaseTestWithFixedDate):
def test_blocklist_upgrade_header(self):
self._test_blocklist_header('upgrade', 'websocket')
+ def test_blocklist_traceparent_header(self):
+ self._test_blocklist_header(
+ 'traceparent',
+ '00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01',
+ )
+
+ def test_blocklist_tracestate_header(self):
+ self._test_blocklist_header('tracestate', 'vendor=state')
+
+ def test_blocklist_baggage_header(self):
+ self._test_blocklist_header('baggage', 'userId=alice,serverNode=DF28')
+
def test_uses_sha256_if_config_value_is_true(self):
self.client_config.s3['payload_signing_enabled'] = True
self.auth.add_auth(self.request)
diff --git a/tests/unit/test_http_session.py b/tests/unit/test_http_session.py
index 7946d46c1..fe2546933 100644
--- a/tests/unit/test_http_session.py
+++ b/tests/unit/test_http_session.py
@@ -147,6 +147,7 @@ class TestURLLib3Session(unittest.TestCase):
preload_content=False,
decode_content=False,
chunked=chunked,
+ enforce_content_length=False,
)
def _assert_manager_call(self, manager, *assert_args, **assert_kwargs):