Skip to content

Commit

Permalink
Merge pull request #55 from alan16742/master
Browse files Browse the repository at this point in the history
fix: access deepest path and load resource separately
  • Loading branch information
vcheckzen authored Oct 2, 2024
2 parents 1ba6291 + 3493bcc commit 425badd
Show file tree
Hide file tree
Showing 2 changed files with 324 additions and 350 deletions.
2 changes: 1 addition & 1 deletion back-end-cf/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async function handleRequest(request) {
'Content-Type': 'application/json; charset=utf-8',
};
const requestUrl = new URL(request.url);
const file = requestUrl.searchParams.get('file') || (requestUrl.pathname.split('/').filter(Boolean).length === 0 ? '' : requestUrl.pathname);
const file = requestUrl.searchParams.get('file') || (requestUrl.pathname.split('/').filter(Boolean).length === 0 ? '' : decodeURIComponent(requestUrl.pathname));
if (file) {
const fileName = file.split('/').pop();
if (fileName.toLowerCase() === PASSWD_FILENAME.toLowerCase())
Expand Down
Loading

0 comments on commit 425badd

Please sign in to comment.