@@ -857,21 +857,14 @@ async def sign_empty(
857857 identity : _AWSCredentialsIdentity ,
858858 properties : SigV4SigningProperties ,
859859 ) -> "EventMessage" :
860- """Produce the SigV4 event-stream terminator frame.
861-
862- The terminator is a signed event-stream message whose outer payload is
863- zero bytes (not a nested encoded empty event). The AWS auth handler
864- requires exactly one such frame immediately before the HTTP body stream
865- is closed; without it the service returns
866- ``InvalidSignatureException: "A complete signal was sent without the
867- preceding empty frame."``.
868-
869- The caller must pass an ``EventMessage`` with no headers and no
870- payload (or whose headers/payload will be overwritten). The returned
871- event carries ``:date`` and ``:chunk-signature`` headers on the outer
872- event-stream envelope and an empty payload, and chains from
873- ``self._prior_signature`` (updating it) so subsequent signed frames
874- continue the chain correctly.
860+ """Sign an Amazon Event Stream final empty message.
861+
862+ The terminator must have a zero-byte outer payload. Calling ``sign``
863+ with an empty event message is not equivalent because ``sign`` wraps the
864+ encoded event message as the payload.
865+
866+ The returned message contains ``:date`` and ``:chunk-signature``
867+ headers and advances the running signature chain.
875868 """
876869 return await self ._sign_payload (
877870 event = event ,
0 commit comments