Skip to content

Commit 46f4ff8

Browse files
committed
fix: ignore random part in download api route
1 parent 31309cd commit 46f4ff8

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

lib/storage/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ export async function initializeStorage() {
271271
}
272272

273273
function createLocalDownloadUrl(objectName: string) {
274-
return `${ENV.API_BASE_URL}/download/${randomBytes(64).toString('base64')}/${objectName}`
274+
return `${ENV.API_BASE_URL}/download/${randomBytes(64).toString('hex')}/${objectName}`
275275
}
276276

277277
export function useStorageAdapter() {

routes/download/[random]/[objectName].ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { useStorageAdapter } from '~/lib/storage'
44

55
const pathParamsSchema = z.object({
66
objectName: z.string(),
7-
hash: z.string(),
87
})
98

109
export default defineEventHandler(async (event) => {

0 commit comments

Comments
 (0)