File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -1112,6 +1112,15 @@ export class AuthorizedHttp2Client extends Http2Client {
1112
1112
const authHeader = 'Authorization' ;
1113
1113
requestCopy . headers [ authHeader ] = `Bearer ${ token } ` ;
1114
1114
1115
+ let quotaProjectId : string | undefined ;
1116
+ if ( this . app . options . credential instanceof ApplicationDefaultCredential ) {
1117
+ quotaProjectId = this . app . options . credential . getQuotaProjectId ( ) ;
1118
+ }
1119
+ quotaProjectId = process . env . GOOGLE_CLOUD_QUOTA_PROJECT || undefined ;
1120
+ if ( ! requestCopy . headers [ 'x-goog-user-project' ] && validator . isNonEmptyString ( quotaProjectId ) ) {
1121
+ requestCopy . headers [ 'x-goog-user-project' ] = quotaProjectId ;
1122
+ }
1123
+
1115
1124
return super . send ( requestCopy ) ;
1116
1125
} ) ;
1117
1126
}
You can’t perform that action at this time.
0 commit comments