Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apollo-engine-reporting: privateHeaders need to be specified in lower-case #2273

Closed
glasser opened this issue Feb 5, 2019 · 0 comments
Closed

Comments

@glasser
Copy link
Member

glasser commented Feb 5, 2019

The privateHeaders option to apollo-engine-reporting is documented as being case-insensitive (appropriate for HTTP headers), and it does work with all casings of actual received headers, but the current implementation accidentally assumes that the header names specified in the privateHeaders option are already lower-case. They should be allowed to be in any case.

          this.options.privateHeaders.includes(key.toLowerCase())
abernix added a commit that referenced this issue Feb 6, 2019
…cumented.

The documentation for `privateHeaders`[[0]] suggests that it is
case-insensitive.  While that statement is true, and the incoming header is
lower-cased before checking it against the `privateHeaders` configuration,
it assumed that the headers in the `privateHeaders` object were specified in
lower-case.

This changes the comparison to lower-case both sides prior to determining
equality.

[0]: https://github.com/apollographql/apollo-server/blob/abb8dc58/packages/apollo-engine-reporting/src/agent.ts#L67-L70

Fixes: #2273
abernix added a commit that referenced this issue Feb 6, 2019
…cumented.

The documentation for `privateHeaders`[[0]] suggests that it is
case-insensitive.  While that statement is true, and the incoming header is
lower-cased before checking it against the `privateHeaders` configuration,
it assumed that the headers in the `privateHeaders` object were specified in
lower-case.

This changes the comparison to lower-case both sides prior to determining
equality.

[0]: https://github.com/apollographql/apollo-server/blob/abb8dc58/packages/apollo-engine-reporting/src/agent.ts#L67-L70

Fixes: #2273
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant