Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianCurtin committed Jan 17, 2025
1 parent 2592fa8 commit 5abd18a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,16 @@ class S3Adapter {
const endpoint = this._endpoint || `https://${this._bucket}.s3.${this._region}.amazonaws.com`;
const location = `${endpoint}/${params.Key}`;

const url = await this.getFileLocation(config, key_without_prefix);
let url;
if (Object.keys(config).length != 0) { // if config is passed, we can generate a presigned url here
url = await this.getFileLocation(config, key_without_prefix);

Check warning on line 192 in index.js

View check run for this annotation

Codecov / codecov/patch

index.js#L192

Added line #L192 was not covered by tests
}

return {
location: location, // actual upload location, used for tests
url: url, // optionally signed url (can be returned to client)
name: key_without_prefix, // filename in storage, consistent with other adapters
s3_response: response // raw s3 response
s3_response: response, // raw s3 response

Check failure on line 198 in index.js

View workflow job for this annotation

GitHub Actions / Lint

Trailing spaces not allowed
...url? {url: url} : {} // url (optionally presigned) or non-direct access url

Check failure on line 199 in index.js

View workflow job for this annotation

GitHub Actions / Lint

Operator '?' must be spaced

Check failure on line 199 in index.js

View workflow job for this annotation

GitHub Actions / Lint

A space is required after '{'

Check failure on line 199 in index.js

View workflow job for this annotation

GitHub Actions / Lint

A space is required before '}'
};
}

Expand Down

0 comments on commit 5abd18a

Please sign in to comment.