Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: BaseHttpResponse.headers incorrectly typed #667

Closed
FokkeZB opened this issue Jun 19, 2023 · 1 comment · Fixed by #736
Closed

[Bug]: BaseHttpResponse.headers incorrectly typed #667

FokkeZB opened this issue Jun 19, 2023 · 1 comment · Fixed by #736
Labels
bug Something isn't working

Comments

@FokkeZB
Copy link
Contributor

FokkeZB commented Jun 19, 2023

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

@FokkeZB FokkeZB added the bug Something isn't working label Jun 19, 2023
@rnegron
Copy link
Member

rnegron commented Jun 19, 2023

Thanks for reporting this bug! I've gone ahead and created a ticket in our internal issue tracker: PDE-4118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants