@@ -86,7 +86,11 @@ export function downloadUrlHandler(
86
86
function handler ( xhr : XhrIo , text : string ) : string | null {
87
87
const metadata = fromResourceString ( service , text , mappings ) ;
88
88
handlerCheck ( metadata !== null ) ;
89
- return downloadUrlFromResourceString ( metadata as Metadata , text ) ;
89
+ return downloadUrlFromResourceString (
90
+ metadata as Metadata ,
91
+ text ,
92
+ service . host
93
+ ) ;
90
94
}
91
95
return handler ;
92
96
}
@@ -143,7 +147,7 @@ export function getMetadata(
143
147
mappings : Mappings
144
148
) : RequestInfo < Metadata > {
145
149
const urlPart = location . fullServerUrl ( ) ;
146
- const url = makeUrl ( urlPart ) ;
150
+ const url = makeUrl ( urlPart , service . host ) ;
147
151
const method = 'GET' ;
148
152
const timeout = service . maxOperationRetryTime ;
149
153
const requestInfo = new RequestInfo (
@@ -179,7 +183,7 @@ export function list(
179
183
urlParams [ 'maxResults' ] = maxResults ;
180
184
}
181
185
const urlPart = location . bucketOnlyServerUrl ( ) ;
182
- const url = makeUrl ( urlPart ) ;
186
+ const url = makeUrl ( urlPart , service . host ) ;
183
187
const method = 'GET' ;
184
188
const timeout = service . maxOperationRetryTime ;
185
189
const requestInfo = new RequestInfo (
@@ -199,7 +203,7 @@ export function getDownloadUrl(
199
203
mappings : Mappings
200
204
) : RequestInfo < string | null > {
201
205
const urlPart = location . fullServerUrl ( ) ;
202
- const url = makeUrl ( urlPart ) ;
206
+ const url = makeUrl ( urlPart , service . host ) ;
203
207
const method = 'GET' ;
204
208
const timeout = service . maxOperationRetryTime ;
205
209
const requestInfo = new RequestInfo (
@@ -219,7 +223,7 @@ export function updateMetadata(
219
223
mappings : Mappings
220
224
) : RequestInfo < Metadata > {
221
225
const urlPart = location . fullServerUrl ( ) ;
222
- const url = makeUrl ( urlPart ) ;
226
+ const url = makeUrl ( urlPart , service . host ) ;
223
227
const method = 'PATCH' ;
224
228
const body = toResourceString ( metadata , mappings ) ;
225
229
const headers = { 'Content-Type' : 'application/json; charset=utf-8' } ;
@@ -241,7 +245,7 @@ export function deleteObject(
241
245
location : Location
242
246
) : RequestInfo < void > {
243
247
const urlPart = location . fullServerUrl ( ) ;
244
- const url = makeUrl ( urlPart ) ;
248
+ const url = makeUrl ( urlPart , service . host ) ;
245
249
const method = 'DELETE' ;
246
250
const timeout = service . maxOperationRetryTime ;
247
251
@@ -321,7 +325,7 @@ export function multipartUpload(
321
325
throw cannotSliceBlob ( ) ;
322
326
}
323
327
const urlParams : UrlParams = { name : metadata_ [ 'fullPath' ] ! } ;
324
- const url = makeUrl ( urlPart ) ;
328
+ const url = makeUrl ( urlPart , service . host ) ;
325
329
const method = 'POST' ;
326
330
const timeout = service . maxUploadRetryTime ;
327
331
const requestInfo = new RequestInfo (
@@ -381,7 +385,7 @@ export function createResumableUpload(
381
385
const urlPart = location . bucketOnlyServerUrl ( ) ;
382
386
const metadataForUpload = metadataForUpload_ ( location , blob , metadata ) ;
383
387
const urlParams : UrlParams = { name : metadataForUpload [ 'fullPath' ] ! } ;
384
- const url = makeUrl ( urlPart ) ;
388
+ const url = makeUrl ( urlPart , service . host ) ;
385
389
const method = 'POST' ;
386
390
const headers = {
387
391
'X-Goog-Upload-Protocol' : 'resumable' ,
0 commit comments