Skip to content

Commit

Permalink
fix: ignore .zip in download links
Browse files Browse the repository at this point in the history
  • Loading branch information
darlanalves committed Jan 23, 2024
1 parent 7ab0f74 commit 4bd8e06
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion filebin.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export async function downloadZip(bin) {
* @returns {string} url
*/
export function getDownloadUrl(bin) {
return u(`/zip/${bin}`).toString();
return u(`/zip/${bin}.zip`).toString();
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ async function onGetUI(_req, res) {
}

async function onDownloadZip(_req, res, args) {
const { binId = '' } = args;
let { binId = '' } = args;
binId = binId.replace('.zip', '');
const binPath = join(rootDir, binId);

if (!(binId && existsSync(binPath))) {
Expand Down

0 comments on commit 4bd8e06

Please sign in to comment.