From 7c91963c7a607cf728b4f96a998d378146bbe2e3 Mon Sep 17 00:00:00 2001 From: Tianlong Wu Date: Thu, 12 Oct 2017 10:40:59 +0800 Subject: [PATCH] use new endpoint convention --- es5/client.js | 4 ++-- lib/client.js | 4 ++-- test/client.test.js | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/es5/client.js b/es5/client.js index 925bdec..e25ec2c 100644 --- a/es5/client.js +++ b/es5/client.js @@ -101,8 +101,8 @@ var Client = function () { var internal = config.internal ? '-internal' : ''; - this.endpoint = `${protocol}://${accountid}.fc.${region}${internal}.aliyuncs.com`; - this.host = `${accountid}.fc.${region}${internal}.aliyuncs.com`; + this.endpoint = `${protocol}://${accountid}.${region}${internal}.fc.aliyuncs.com`; + this.host = `${accountid}.${region}${internal}.fc.aliyuncs.com`; this.version = '2016-08-15'; this.timeout = Number.isFinite(config.timeout) ? config.timeout : 10000; // default is 10s } diff --git a/lib/client.js b/lib/client.js index efa8354..c7769b5 100644 --- a/lib/client.js +++ b/lib/client.js @@ -89,8 +89,8 @@ class Client { const internal = config.internal ? '-internal': ''; - this.endpoint = `${protocol}://${accountid}.fc.${region}${internal}.aliyuncs.com`; - this.host = `${accountid}.fc.${region}${internal}.aliyuncs.com`; + this.endpoint = `${protocol}://${accountid}.${region}${internal}.fc.aliyuncs.com`; + this.host = `${accountid}.${region}${internal}.fc.aliyuncs.com`; this.version = '2016-08-15'; this.timeout = Number.isFinite(config.timeout) ? config.timeout : 10000; // default is 10s } diff --git a/test/client.test.js b/test/client.test.js index 75082b4..553d041 100644 --- a/test/client.test.js +++ b/test/client.test.js @@ -55,7 +55,7 @@ describe('client test', function () { accessKeySecret: 'accessKeySecret', region: 'cn-shanghai' }); - expect(client.endpoint).to.be('http://accountid.fc.cn-shanghai.aliyuncs.com'); + expect(client.endpoint).to.be('http://accountid.cn-shanghai.fc.aliyuncs.com'); client = new FunctionComputeClient('accountid', { accessKeyID: 'STS.accessKeyID', @@ -63,7 +63,7 @@ describe('client test', function () { region: 'cn-shanghai', securityToken: 'securityToken', }); - expect(client.endpoint).to.be('http://accountid.fc.cn-shanghai.aliyuncs.com'); + expect(client.endpoint).to.be('http://accountid.cn-shanghai.fc.aliyuncs.com'); client = new FunctionComputeClient('accountid', { accessKeyID: 'accessKeyID', @@ -71,7 +71,7 @@ describe('client test', function () { region: 'cn-shanghai', secure: true }); - expect(client.endpoint).to.be('https://accountid.fc.cn-shanghai.aliyuncs.com'); + expect(client.endpoint).to.be('https://accountid.cn-shanghai.fc.aliyuncs.com'); client = new FunctionComputeClient('accountid', { accessKeyID: 'accessKeyID', @@ -80,7 +80,7 @@ describe('client test', function () { secure: true, internal: true }); - expect(client.endpoint).to.be('https://accountid.fc.cn-shanghai-internal.aliyuncs.com'); + expect(client.endpoint).to.be('https://accountid.cn-shanghai-internal.fc.aliyuncs.com'); client = new FunctionComputeClient('accountid', { accessKeyID: 'accessKeyID',