Skip to content

Commit

Permalink
fix(baggage): oversized header warn only with a header
Browse files Browse the repository at this point in the history
This commit makes sure that warnings about the baggage header length are
only emitted when the header is actually present, since it does not make
sense to warn about a missing header's length.
  • Loading branch information
Nicolas Marier committed Oct 15, 2021
1 parent 39fe4db commit aaf88ea
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ def extract(
)

if not header or len(header) > self._MAX_HEADER_LENGTH:
_logger.warning(
"Baggage header `%s` exceeded the maximum number of bytes per baggage-string",
header,
)
if header:
_logger.warning(
"Baggage header `%s` exceeded the maximum number of bytes per baggage-string",
header,
)
return context

baggage_entries = split(_DELIMITER_PATTERN, header)
Expand Down

0 comments on commit aaf88ea

Please sign in to comment.