zapier / zapier-platform

The SDK for you to build an integration on Zapier

Home Page:https://platform.zapier.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: BaseHttpResponse.headers incorrectly typed

FokkeZB opened this issue · comments

Bug Description

At

headers: { [key: string]: string };
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

  1. After getting a response with z.request(), try to read a header using response.headers['content-type'] and find it returns undefined.
  2. Try to use response.headers.get('content-type') and find TypeScript raises a type error.
  3. 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