googleapis / gaxios

An HTTP request client that provides an axios like interface over top of node-fetch. Super lightweight. Supports proxies and all sorts of other stuff.
Apache License 2.0
796 stars 60 forks source link

feat!: Headers should be `Headers` #653

Closed danielbankhead closed 3 weeks ago

danielbankhead commented 1 month ago

Headers should be Headers:

// creates, if not exist, or appends to an existing header headers.append('x-goog-api-client', 'abc');


# Migration Guide

Simply pass non-`Headers` into `Headers`.

old:
```ts
const headers = {"my-headers": "value"};

new:

const headers = new Headers({"my-headers": "value"});

Background

🦕

generated-files-bot[bot] commented 1 month ago

Warning: This pull request is touching the following templated files:

sofisl commented 3 weeks ago

This, along with #600 and #621 are going to cause breaking changes in auth + google-api-nodejs-client (and any other dependents). Since we don't have that level of integration tests, I'd strongly recommend releasing an experimental version of this library manually once you've merged all the breaking changes (but without merging the actual new release) and seeing what breaks in auth and GANC. That way you can preview breaking tests and any other changes, and you can revert anything if necessary before we release a new version of gaxios. In the future though, we would ideally just have these tests connected.