[Bug]: BaseHttpResponse.headers incorrectly typed
FokkeZB opened this issue · comments
Bug Description
At
zapier-platform/packages/core/index.d.ts
Line 104 in c0da673
BaseHttpResponse.headers
is typed as { [key: string]: string }
but I've found that this is a node-fetch
Headers
class object instead: https://github.com/node-fetch/node-fetch/blob/7b86e946b02dfdd28f4f8fca3d73a022cbb5ca1e/%40types/index.d.ts#L40
Reproduction Steps
- After getting a
response
withz.request()
, try to read a header usingresponse.headers['content-type']
and find it returnsundefined
. - Try to use
response.headers.get('content-type')
and find TypeScript raises a type error. - Ignore it and find it does return the expected value (meaning the type is wrong).
Zapier Platform version
14.1.1
Node.js version
v18.15.0
Your Operating System
13.4 (22F66)
npm/yarn version
1.22.19
App ID
185850
More Details
No response
Thanks for reporting this bug! I've gone ahead and created a ticket in our internal issue tracker: PDE-4118