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

refactor(http): Import proper OutgoingHttpHeaders on all http clients #9653

Merged

Conversation

zharinov
Copy link
Collaborator

Changes:

Fix imports, remove unknown type, remove TODO item.

Context:

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please tick one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added unit tests, or
  • No new tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

lib/util/http/index.ts Outdated Show resolved Hide resolved
@@ -23,3 +23,7 @@ export interface RequestStats {
duration: number;
queueDuration: number;
}

export interface OutgoingHttpHeaders {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should extend from Record here

@zharinov
Copy link
Collaborator Author

Deep merge of got options didn't affect any tests and somehow related to headers. So, pushing one more commit here.

@@ -23,3 +23,7 @@ export interface RequestStats {
duration: number;
queueDuration: number;
}

export interface OutgoingHttpHeaders extends Record<string, unknown> {
[header: string]: string | string[] | undefined;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove and add this types to second record type

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced by Record<string, string | string[] | undefined>, because empty interfaces don't lint well

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better use a type def then?

@@ -23,3 +23,5 @@ export interface RequestStats {
duration: number;
queueDuration: number;
}

export type OutgoingHttpHeaders = Record<string, string | string[] | undefined>;
Copy link
Collaborator Author

@zharinov zharinov Apr 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@viceice Okay, just commit your suggestion, please 🙃

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, not easy from 📲 😅

@rarkins rarkins merged commit 2d04ae6 into renovatebot:master Apr 20, 2021
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 24.119.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants