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

null clientType is converted to 'null' string #161

Closed
gbarbon opened this issue Nov 16, 2021 · 1 comment
Closed

null clientType is converted to 'null' string #161

gbarbon opened this issue Nov 16, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@gbarbon
Copy link

gbarbon commented Nov 16, 2021

The feature or bug you are proposing

The library is converting the null value into the null string headers, e.g. for the CLIENTTYPE_HEADER_KEY. This results in forwarding that given header with the null string as value even when the header is actually not provided/forwarder.

The description of the bug or the rationale of your proposal

The library should not forward heraders when those are set to null, or at least forward those with an empty string instead.

Note that while this bug has been discovered for the CLIENTTYPE_HEADER_KEY, it is impacting also other headers.

A snippet of code for replicating the issue or showing the proposal usage if applicable

A possible solution can be replacing:

function getClientType(clientType) {
  return clientType || null
}

with:

function getClientType(clientType) {
  return clientType || ''
}

The expected result for your bug

The library should not forward a header if the header is set to null.

Your environment

node: 12.19.0-alpine
custom-plugin-lib: 4.2.0
os: --

@gbarbon gbarbon added the bug Something isn't working label Nov 16, 2021
@davidebianchi
Copy link
Member

This is resolved by #225 and it will be released in the next version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants