Skip to content

Commit

Permalink
fix dns name for buckets with a period (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
wperron authored Nov 17, 2020
1 parent cf7f063 commit a9d4fa5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
deno-version: [v1.4.2, nightly]
deno-version: [v1.x, nightly]
unstable: [false, true]
# FIXME(lucacasonato): temporarially disable no-check testing (see https://github.com/denoland/deno/issues/7709)
no-check: [false]
no-check: [false, true]
env:
AWS_ACCESS_KEY_ID: AKIAIOSFODNN7EXAMPLE
AWS_SECRET_ACCESS_KEY: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
steps:
- name: Setup Deno environment
uses: denolib/setup-deno@v2.2.0
uses: denolib/setup-deno@v2.3.0
with:
deno-version: ${{ matrix.deno-version }}

Expand Down
4 changes: 3 additions & 1 deletion src/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export class S3Bucket {
this.#bucket = config.bucket;
this.#host = config.endpointURL
? new URL(`/${config.bucket}/`, config.endpointURL).toString()
: config.bucket.indexOf(".") >= 0
? `https://s3.${config.region}.amazonaws.com/${config.bucket}/`
: `https://${config.bucket}.s3.${config.region}.amazonaws.com/`;
}

Expand Down Expand Up @@ -494,7 +496,7 @@ export class S3Bucket {
async empty(): Promise<string[]> {
const deleted: string[] = [];
for await (
let k of pooledMap(
const k of pooledMap(
50,
this.listAllObjects({ batchSize: 1000 }),
async (o) => {
Expand Down
6 changes: 3 additions & 3 deletions src/bucket_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Deno.test({
];

try {
for (let k of keys) {
for (const k of keys) {
await bucket.putObject(k, content, { contentType: "text/plain" });
}

Expand Down Expand Up @@ -215,7 +215,7 @@ Deno.test({
]);
} finally {
// teardown
for (let k of keys) {
for (const k of keys) {
await bucket.deleteObject(k);
}
}
Expand All @@ -240,7 +240,7 @@ Deno.test({
"fruits/orange",
];

for (let k of keys) {
for (const k of keys) {
await bucket.putObject(k, content, { contentType: "text/plain" });
}

Expand Down

0 comments on commit a9d4fa5

Please sign in to comment.