зеркало из https://github.com/Azure/ms-rest-js.git
Avoid modyfing baseUrl of OperationSpec
This commit is contained in:
Родитель
6a66832cb7
Коммит
0f346bfc19
|
@ -183,17 +183,15 @@ export class ServiceClient {
|
|||
|
||||
let result: Promise<HttpOperationResponse>;
|
||||
try {
|
||||
if (operationSpec.baseUrl == undefined) {
|
||||
operationSpec.baseUrl = this.baseUri;
|
||||
if (!operationSpec.baseUrl) {
|
||||
if (operationSpec.baseUrl == undefined && this.baseUri == undefined) {
|
||||
throw new Error("If operationSpec.baseUrl is not specified, then the ServiceClient must have a baseUri string property that contains the base URL to use.");
|
||||
}
|
||||
}
|
||||
|
||||
httpRequest.method = operationSpec.httpMethod;
|
||||
httpRequest.operationSpec = operationSpec;
|
||||
|
||||
const requestUrl: URLBuilder = URLBuilder.parse(operationSpec.baseUrl);
|
||||
const baseUri: string = (operationSpec.baseUrl || this.baseUri) as string
|
||||
const requestUrl: URLBuilder = URLBuilder.parse(baseUri);
|
||||
if (operationSpec.path) {
|
||||
requestUrl.setPath(operationSpec.path);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче