undici icon indicating copy to clipboard operation
undici copied to clipboard

fetch: add docs on why forbidden header names are not supported

Open trivikr opened this issue 1 year ago • 4 comments

This relates to...

  • Comment https://github.com/nodejs/undici/pull/3695#pullrequestreview-2350953699
  • Fetch spec https://fetch.spec.whatwg.org/#concept-headers-append

Changes

Documents why undici fetch does not support forbidden header names

Features

N/A

Bug Fixes

N/A

Breaking Changes and Deprecations

N/A

Status

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

trivikr avatar Oct 07 '24 06:10 trivikr

I find the comments harder to read considering it merges two different spec functions (I understand they're out of date). I don't see any value in documenting why we don't implement forbidden headers either as it's well-known and documented already.

KhafraDev avatar Oct 07 '24 18:10 KhafraDev

The benefit is for developers who read the code on while going through the implementation.

trivikr avatar Oct 07 '24 18:10 trivikr

Why do we deviate from the spec?

image

Uzlopak avatar Oct 07 '24 18:10 Uzlopak

The source code is for https://fetch.spec.whatwg.org/#concept-headers-append The link is provided in "relates to" section, as well as existing documentation, i.e. line 83, in the source code.

The screenshot provided is for https://fetch.spec.whatwg.org/#headers-class

trivikr avatar Oct 07 '24 19:10 trivikr