Skip to content

parseKeyPairsIntoRecord does not parse if value conatains equals #3974

@krosenk729

Description

@krosenk729

What happened?

Steps to Reproduce

var exampleValidBaggage = `key=aGVsbG8gd29ybGQhOiE6IQ==`;
var res = parseKeyPairsIntoRecord(exampleValidBaggage)
// res will not have the parsed key as expected

Expected Result

the above example should parse the value to
{ key: 'aGVsbG8gd29ybGQhOiE6IQ==' }

Actual Result

the above example is returning {}

Additional Details

according to https://github.com/w3c/baggage/blob/main/baggage/HTTP_HEADER_FORMAT.md, value MAY contain any number of the equal sign (=) characters. Parsers MUST NOT assume that the equal sign is only used to separate key and value.

however, parseKeyPairsIntoRecord is assuming the equal sign is only a key separator

OpenTelemetry Setup Code

No response

package.json

No response

Relevant log output

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpriority:p2Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions