Skip to content

Commit

Permalink
Fix incorrect patrhing n bucketname
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkCupitt committed Apr 27, 2023
1 parent fb54949 commit 767eb77
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build/aws.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/aws.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/s3.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/s3.js.map

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions src/internal/s3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ export class S3Client extends AWSClient {
listObjects(bucketName: string, prefix?: string): Array<S3Object> {
// Prepare request
const method = 'GET'
const host = `${bucketName}.${this.host}`
const host = `${this.host}`

const signedRequest: SignedHTTPRequest = this.signature.sign(
{
method: 'GET',
protocol: this.scheme,
hostname: host,
path: '/',
path: `/${bucketName}/`,
query: {
'list-type': '2',
prefix: prefix || '',
Expand Down Expand Up @@ -171,14 +171,14 @@ export class S3Client extends AWSClient {
getObject(bucketName: string, objectKey: string): S3Object {
// Prepare request
const method = 'GET'
const host = `${bucketName}.${this.host}`
const host = `${this.host}`

const signedRequest = this.signature.sign(
{
method: 'GET',
protocol: this.scheme,
hostname: host,
path: `/${objectKey}`,
path: `/${bucketName}/${objectKey}`,
headers: {},
},
{}
Expand Down Expand Up @@ -216,14 +216,14 @@ export class S3Client extends AWSClient {
putObject(bucketName: string, objectKey: string, data: string | ArrayBuffer) {
// Prepare request
const method = 'PUT'
const host = `${bucketName}.${this.host}`

const host = `${this.host}`
const signedRequest = this.signature.sign(
{
method: method,
protocol: this.scheme,
hostname: host,
path: `/${objectKey}`,
path: `/${bucketName}/${objectKey}`,
headers: {
'Host': host,
},
Expand All @@ -250,14 +250,14 @@ export class S3Client extends AWSClient {
deleteObject(bucketName: string, objectKey: string): void {
// Prepare request
const method = 'DELETE'
const host = `${bucketName}.${this.host}`
const host = `${this.host}`

const signedRequest = this.signature.sign(
{
method: method,
protocol: this.scheme,
hostname: host,
path: `/${objectKey}`,
path: `/${bucketName}/${objectKey}`,
headers: {},
},
{}
Expand Down

0 comments on commit 767eb77

Please sign in to comment.