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

feat(APIRequest): support setting global headers in HTTPOptions #5586

Merged
merged 2 commits into from
May 10, 2021

Conversation

advaith1
Copy link
Contributor

@advaith1 advaith1 commented May 4, 2021

Please describe the changes this PR makes and why it should be merged:
Adds support for setting ClientOptions#http#headers to an object of headers which will be set on all API requests.

This is useful for using the canary API, setting a global audit log reason, and maybe other stuff in the future

The unrelated typings changes seem to have been automatically done by commit hooks

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating
  • This PR changes the library's interface (methods or parameters added)

(commitlint didn't like naming the scope APIRequest)

kyranet
kyranet previously requested changes May 4, 2021
src/rest/APIRequest.js Outdated Show resolved Hide resolved
Co-authored-by: Vlad Frangu <[email protected]>
@advaith1 advaith1 requested a review from kyranet May 4, 2021 16:58
@iCrawl iCrawl merged commit 135abcc into discordjs:master May 10, 2021
@advaith1 advaith1 deleted the headers branch May 10, 2021 23:05
@iCrawl iCrawl added this to the Version 13 milestone Jun 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants