-
Notifications
You must be signed in to change notification settings - Fork 414
fix: upgrade @google-cloud/storage@7.19.0 #3071
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -730,7 +730,7 @@ class AsyncHttpCall extends AsyncRequestCall { | |
| try { | ||
| this.httpConfigImpl = httpConfigImpl; | ||
| this.options = this.httpConfigImpl.buildRequestOptions(); | ||
| this.entity = this.httpConfigImpl.buildEntity(this.options.headers!); | ||
| this.entity = this.httpConfigImpl.buildEntity(this.options.headers as http.OutgoingHttpHeaders); | ||
| this.promise = new Promise((resolve, reject) => { | ||
| this.resolve = resolve; | ||
| this.reject = reject; | ||
|
|
@@ -828,7 +828,7 @@ class AsyncHttp2Call extends AsyncRequestCall { | |
| try { | ||
| this.http2ConfigImpl = http2ConfigImpl; | ||
| this.options = this.http2ConfigImpl.buildRequestOptions(); | ||
| this.entity = this.http2ConfigImpl.buildEntity(this.options.headers!); | ||
| this.entity = this.http2ConfigImpl.buildEntity(this.options.headers as http.OutgoingHttpHeaders); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to the previous comment, using a type assertion with if (!this.options.headers) {
this.options.headers = {};
}
this.entity = this.http2ConfigImpl.buildEntity(this.options.headers);
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this one should be |
||
| this.promise = new Promise((resolve, reject) => { | ||
| this.resolve = resolve; | ||
| this.reject = reject; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While using
as http.OutgoingHttpHeadersworks, it's a type assertion that tells the compiler to trust you, which can hide potential bugs if the type assumptions are wrong. A safer and clearer approach is to use a type guard. This ensuresthis.options.headersis always an object, making the code more robust against future changes and satisfying the compiler without forcing a type.