Move orchestration ID logic to constructor for efficiency
Co-authored-by: TingluoHuang <1750815+TingluoHuang@users.noreply.github.com>
This commit is contained in:
@@ -148,6 +148,8 @@ export class HttpClient {
|
||||
requestOptions?: ifm.RequestOptions
|
||||
) {
|
||||
this.userAgent = userAgent
|
||||
? this._getUserAgentWithOrchestrationId(userAgent)
|
||||
: undefined
|
||||
this.handlers = handlers || []
|
||||
this.requestOptions = requestOptions
|
||||
if (requestOptions) {
|
||||
@@ -599,8 +601,7 @@ export class HttpClient {
|
||||
info.options.method = method
|
||||
info.options.headers = this._mergeHeaders(headers)
|
||||
if (this.userAgent != null) {
|
||||
info.options.headers['user-agent'] =
|
||||
this._getUserAgentWithOrchestrationId(this.userAgent)
|
||||
info.options.headers['user-agent'] = this.userAgent
|
||||
}
|
||||
|
||||
info.options.agent = this._getAgent(info.parsedUrl)
|
||||
|
||||
Reference in New Issue
Block a user