Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2373 +/- ##
==========================================
+ Coverage 85.54% 85.84% +0.29%
==========================================
Files 76 76
Lines 6858 6886 +28
==========================================
+ Hits 5867 5911 +44
+ Misses 991 975 -16
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Technically webidl will handle any type we pass (null, numbers, objects, arrays, etc.) but we should be explicit in what types/values are expected (being what the spec tells us). Typescript's own DOM types do as much https://github.com/microsoft/TypeScript/blob/11a04ed9086e1e89cab970901b3496d5a67bcf59/src/lib/dom.generated.d.ts#L27983
|
IMO the ReadonlyArray should be removed because it's not an expected value, I'm really not sure how that ended up there. Webidl will handle it, but probably not in an expected way, and we probably shouldn't encourage people to misuse it. |
|
I hear ya but we should match browser behavior. And honestly our types should match our implementation. If the spec does say to fail on undefined, and if our implementation doesn't fail on it either, I see little harm in adjusting the types so that we can avoid an unnecessary |
|
If you pass |
…r.mts` (#10767) In a recent undici update, setting the `host` header for fetch requests became invalid (nodejs/undici#2322). We relied on this in order to proxy serverless dev server requests via `@vercel/node`. This PR replaces the usage of `undici.fetch` with `undici.request`. It is blocked by an `undici` type change: nodejs/undici#2373
|
Closing due too inactivity. |
This PR improves the
HeadersInittype. The spec sorta gets this wrong (https://fetch.spec.whatwg.org/#typedefdef-headersinit) It only specifiesrecord<ByteString, ByteString>, butrecord<ByteString, ByteString | undefinedalso works. I've tested it in multiple browsers and our implementation, and it works fine.This allows me to pass an
IncomingHTTPHeadersobject directly to the constructor (which is valid for all other reasons except for this missing| undefined).