Skip to content

Commit

Permalink
忽略大小写比较
Browse files Browse the repository at this point in the history
  • Loading branch information
vcheckzen authored Sep 16, 2024
1 parent 6d39bae commit 4f322cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions back-end-deployment-helper/src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const apiHost = "${apiHost}";
const redirectUri = "${replayURL}";
addEventListener('scheduled', event => {
event.waitUntil(fetchAccessToken( /* event.scheduledTime */));
event.waitUntil(fetchAccessToken(/* event.scheduledTime */));
});
addEventListener("fetch", (event) => {
Expand Down Expand Up @@ -67,7 +67,7 @@ async function handleRequest(request) {
if ((querySplited && querySplited[0] === "file") || abnormalWay) {
const file = querySplited[1];
const fileName = file.split("/").pop();
if (fileName === PASSWD_FILENAME)
if (fileName.toLowerCase() === PASSWD_FILENAME.toLowerCase())
return Response.redirect(
"https://www.baidu.com/s?wd=%E6%80%8E%E6%A0%B7%E7%9B%97%E5%8F%96%E5%AF%86%E7%A0%81",
301
Expand All @@ -79,7 +79,7 @@ async function handleRequest(request) {
requestPath = querySplited[1];
const uploadAllow = await fetchFiles(requestPath, ".upload");
const fileList = await request.json();
const pwAttack = fileList["files"].some(file => file.remotePath.split("/").pop() === PASSWD_FILENAME);
const pwAttack = fileList["files"].some(file => file.remotePath.split("/").pop().toLowerCase() === PASSWD_FILENAME.toLowerCase());
if (uploadAllow && !pwAttack) {
const uploadLinks = await uploadFiles(fileList);
return new Response(uploadLinks, {
Expand Down

0 comments on commit 4f322cc

Please sign in to comment.