Skip to content

Commit 7b194e3

Browse files
authored
disallow empty string for baggage name (#1484)
spec 1.36.0 clarifies that empty string is not a valid baggage name
1 parent 74b1a03 commit 7b194e3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Baggage/BaggageBuilder.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ public function remove(string $key): BaggageBuilderInterface
2222
/** @inheritDoc */
2323
public function set(string $key, $value, ?MetadataInterface $metadata = null): BaggageBuilderInterface
2424
{
25+
if ($key === '') {
26+
return $this;
27+
}
2528
$metadata ??= Metadata::getEmpty();
2629

2730
$this->entries[$key] = new Entry($value, $metadata);

0 commit comments

Comments
 (0)