Skip to content

Commit 27fa02f

Browse files
JustinBeckwithstephenplusplus
authored andcommitted
fix: use storage.googleapis.com for api endpoint (#854)
1 parent fdf70bb commit 27fa02f

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ const STORAGE_DOWNLOAD_BASE_URL = 'https://storage.googleapis.com';
278278
* @private
279279
*/
280280
const STORAGE_UPLOAD_BASE_URL =
281-
'https://www.googleapis.com/upload/storage/v1/b';
281+
'https://storage.googleapis.com/upload/storage/v1/b';
282282

283283
/**
284284
* @const {RegExp}

src/storage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export interface StorageOptions extends GoogleAuthOptions {
5353
promise?: typeof Promise;
5454
/**
5555
* The API endpoint of the service used to make requests.
56-
* Defaults to `www.googleapis.com`.
56+
* Defaults to `storage.googleapis.com`.
5757
*/
5858
apiEndpoint?: string;
5959
}
@@ -372,7 +372,7 @@ export class Storage extends Service {
372372
* @param {StorageOptions} [options] Configuration options.
373373
*/
374374
constructor(options: StorageOptions = {}) {
375-
options.apiEndpoint = options.apiEndpoint || 'www.googleapis.com';
375+
options.apiEndpoint = options.apiEndpoint || 'storage.googleapis.com';
376376
const url =
377377
process.env.STORAGE_EMULATOR_HOST ||
378378
`https://${options.apiEndpoint}/storage/v1`;

test/file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3822,7 +3822,7 @@ describe('File', () => {
38223822
predefinedAcl: options.predefinedAcl,
38233823
},
38243824
uri:
3825-
'https://www.googleapis.com/upload/storage/v1/b/' +
3825+
'https://storage.googleapis.com/upload/storage/v1/b/' +
38263826
file.bucket.name +
38273827
'/o',
38283828
});

test/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ describe('Storage', () => {
128128

129129
const calledWith = storage.calledWith_[0];
130130

131-
const baseUrl = 'https://www.googleapis.com/storage/v1';
131+
const baseUrl = 'https://storage.googleapis.com/storage/v1';
132132
assert.strictEqual(calledWith.baseUrl, baseUrl);
133133
assert.strictEqual(calledWith.projectIdRequired, false);
134134
assert.deepStrictEqual(calledWith.scopes, [

0 commit comments

Comments
 (0)