Skip to content

Commit 2a43abf

Browse files
committed
Fix failure due to storage url
1 parent c0146ae commit 2a43abf

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060

6161
DRIVE_DISK: "fs"
6262
FS_ASSET_PATH: ./tmp/fakes
63-
ASSET_URL_BASE: "http://hollo.test/"
63+
STORAGE_URL_BASE: "http://hollo.test/"
6464
steps:
6565
- uses: actions/checkout@v4
6666
- uses: pnpm/action-setup@v4

src/pages/emojis.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe("emojis", () => {
4646
t.assert.equal(emoji.category, null, "Defaults category to null");
4747
t.assert.equal(
4848
emoji.url,
49-
"emojis/test-emoji.png",
49+
"http://hollo.test/assets/emojis/test-emoji.png",
5050
"Sets the file URL correctly",
5151
);
5252
t.assert.equal(emoji.shortcode, "test-emoji");

src/storage.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,13 @@ export const drive = new DriveManager({
101101
location: new URL("../tmp/fakes", import.meta.url),
102102
urlBuilder: {
103103
async generateURL(key) {
104-
return `http://hollo.test/assets/${key}`;
104+
return new URL(`/assets/${key}`, storageUrlBase).href;
105105
},
106106
async generateSignedURL(key) {
107-
return `http://hollo.test/assets/${key}?signature=true`;
107+
const url = new URL(`/assets/${key}`, storageUrlBase);
108+
url.searchParams.set("signature", "true");
109+
110+
return url.href;
108111
},
109112
},
110113
},

0 commit comments

Comments
 (0)