undici icon indicating copy to clipboard operation
undici copied to clipboard

dup-keys-non-strings

Open JavaLavaMT opened this issue 1 year ago • 5 comments

This relates to #1902

Rationale

now throws an error if the headers key is not a string or duplicated

Changes

  • added Tests
  • added a guard for duplicate headers
  • added a guard for non string header keys

Breaking Changes and Deprecations

Not sure, but this will block ALL requests that have headers which are not of type 'String' or are duplicated.

Status

  • [x] I have read and agreed to the Developer's Certificate of Origin
  • [x] Tested
  • [ ] Benchmarked (optional)
  • [ ] Documented
  • [x] Review ready
  • [ ] In review
  • [ ] Merge ready

JavaLavaMT avatar Apr 25 '24 17:04 JavaLavaMT

I think duplicate headers are allowed by the spec

ronag avatar Apr 25 '24 17:04 ronag

Actually not sure what is correct here.

ronag avatar Apr 25 '24 17:04 ronag

@ronag I think duplicates are only list values? https://www.rfc-editor.org/rfc/rfc9110.html#section-5.2 https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2

James1x0 avatar Apr 25 '24 17:04 James1x0

based on https://www.rfc-editor.org/rfc/rfc9110.html#name-field-lines-and-combined-fi

seems like keys CAN be duplicates as long as the values are an array. If i am understanding this correct, commit # 698e64e should fix this.

JavaLavaMT avatar Apr 25 '24 18:04 JavaLavaMT

The actual commit still seems to have the implementation that throws on duplicate, can we verify we change it?

metcoder95 avatar Apr 25 '24 20:04 metcoder95