Skip to content

Issue with casing of headers #16

Closed
@eric-swann-q2

Description

@eric-swann-q2

I noticed that one of the tests was failing and that one of my changes had been reverted, which was causing the test failure. It's this line:

const segment = new AWSXray.Segment(name, header.Root, header.Parent);

Following what was done in the express middleware, I had changed it to:

const segment = new AWSXray.Segment(name, header.root, header.parent);

The test stub sets up the headers expecting them to be lowercase.

I know that node typically lowercases headers:
nodejs/node-v0.x-archive#1954

Was this causing an issue for you in your testing with the segment not getting set properly?

Would it make sense to do the following in case they do come in lowercased?

const segment = new AWSXray.Segment(name, header.Root || header.root, 
header.Parent || header.parent);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions