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

fix(codegen): allow empty string field values for headers #1412

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

siddsriv
Copy link
Contributor

Issue #, if available:
Internal JS-5444

Description of changes:
allows headers to have empty field values.

for more details, relevant RFC: https://www.rfc-editor.org/rfc/rfc9110.html#section-5.5


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@siddsriv siddsriv requested review from a team as code owners September 20, 2024 20:44
@siddsriv siddsriv requested a review from gosar September 20, 2024 20:44
(!Object.getOwnPropertyNames(value).includes("length") ||
value.length != 0) &&
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
value != undefined && value != null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

value != null is enough, since undefined will match

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to cover this with some unit tests? would be nice to see what cases we are considering

(!Object.getOwnPropertyNames(value).includes("length") ||
value.length != 0) &&
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
value != undefined && value != null;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. we should keep !== as we did before for null and undef checks
  2. Are we not worried about value.size anymore?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants