Skip to content

Commit a9d4fa5

Browse files
authored
fix dns name for buckets with a period (#16)
1 parent cf7f063 commit a9d4fa5

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
deno-version: [v1.4.2, nightly]
15+
deno-version: [v1.x, nightly]
1616
unstable: [false, true]
17-
# FIXME(lucacasonato): temporarially disable no-check testing (see https://github.com/denoland/deno/issues/7709)
18-
no-check: [false]
17+
no-check: [false, true]
1918
env:
2019
AWS_ACCESS_KEY_ID: AKIAIOSFODNN7EXAMPLE
2120
AWS_SECRET_ACCESS_KEY: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
2221
steps:
2322
- name: Setup Deno environment
24-
uses: denolib/setup-deno@v2.2.0
23+
uses: denolib/setup-deno@v2.3.0
2524
with:
2625
deno-version: ${{ matrix.deno-version }}
2726

src/bucket.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ export class S3Bucket {
4848
this.#bucket = config.bucket;
4949
this.#host = config.endpointURL
5050
? new URL(`/${config.bucket}/`, config.endpointURL).toString()
51+
: config.bucket.indexOf(".") >= 0
52+
? `https://s3.${config.region}.amazonaws.com/${config.bucket}/`
5153
: `https://${config.bucket}.s3.${config.region}.amazonaws.com/`;
5254
}
5355

@@ -494,7 +496,7 @@ export class S3Bucket {
494496
async empty(): Promise<string[]> {
495497
const deleted: string[] = [];
496498
for await (
497-
let k of pooledMap(
499+
const k of pooledMap(
498500
50,
499501
this.listAllObjects({ batchSize: 1000 }),
500502
async (o) => {

src/bucket_test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ Deno.test({
159159
];
160160

161161
try {
162-
for (let k of keys) {
162+
for (const k of keys) {
163163
await bucket.putObject(k, content, { contentType: "text/plain" });
164164
}
165165

@@ -215,7 +215,7 @@ Deno.test({
215215
]);
216216
} finally {
217217
// teardown
218-
for (let k of keys) {
218+
for (const k of keys) {
219219
await bucket.deleteObject(k);
220220
}
221221
}
@@ -240,7 +240,7 @@ Deno.test({
240240
"fruits/orange",
241241
];
242242

243-
for (let k of keys) {
243+
for (const k of keys) {
244244
await bucket.putObject(k, content, { contentType: "text/plain" });
245245
}
246246

0 commit comments

Comments
 (0)