Skip to content

Commit

Permalink
fix prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
nicnocquee committed Nov 21, 2023
1 parent 655301e commit 5d0224a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion app/api/download/[file_name]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ export const GET = async (
return new Response(content, {
status: 200,
headers: {
"content-disposition": `attachment; filename="${encodeURIComponent(decodedFileName)}"`
"content-disposition": `attachment; filename="${encodeURIComponent(
decodedFileName
)}"`
}
});
};
6 changes: 3 additions & 3 deletions middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ function isAuthenticated(req: NextRequest) {
return false;
}

const encodedCredentials = authheader.split(' ')[1];
const buffer = Buffer.from(encodedCredentials, 'base64');
const encodedCredentials = authheader.split(" ")[1];
const buffer = Buffer.from(encodedCredentials, "base64");
const decodedCredentials = buffer.toString();
const colonIndex = decodedCredentials.indexOf(':');
const colonIndex = decodedCredentials.indexOf(":");
if (colonIndex === -1) {
return false; // Malformed credentials
}
Expand Down

0 comments on commit 5d0224a

Please sign in to comment.