Skip to content

Commit 5ad4aa0

Browse files
committed
moved hostname to a variable
1 parent 4880ef3 commit 5ad4aa0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/typescript/create-preauth-req.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ if (args.length !== 2) {
3636

3737
const directoryPath: string = args[0]; // for eg : "/Users/Abc/upload-manager";
3838
const bucketName = args[1];
39+
const hostName = "objectstorage"
3940

4041
const client = new ObjectStorageClient({ authenticationDetailsProvider: provider });
4142
client.region = Region.US_PHOENIX_1;
@@ -77,7 +78,7 @@ client.region = Region.US_PHOENIX_1;
7778
// create pre authenticated request to generate the url
7879
const resp = await client.createPreauthenticatedRequest(createPreauthenticatedRequest);
7980
const baseUrl =
80-
"https://objectstorage." + common.Region.US_PHOENIX_1.regionId + ".oraclecloud.com";
81+
"https://" + hostName + "." + common.Region.US_PHOENIX_1.regionId + ".oraclecloud.com";
8182
const downloadUrl = resp.preauthenticatedRequest.accessUri;
8283
console.log("download url for the file " + filename + " is " + baseUrl + downloadUrl);
8384

0 commit comments

Comments
 (0)