فهرست منبع

use double-quotes

Pouria Ezzati 9 ماه پیش
والد
کامیت
eef96b3eed
1فایلهای تغییر یافته به همراه5 افزوده شده و 5 حذف شده
  1. 5 5
      server/handlers/links.handler.js

+ 5 - 5
server/handlers/links.handler.js

@@ -504,15 +504,15 @@ async function redirect(req, res, next) {
 
 
   // 6. If link is protected, redirect to password page
   // 6. If link is protected, redirect to password page
   if (link.password) {
   if (link.password) {
-    if ('authorization' in req.headers) {
+    if ("authorization" in req.headers) {
       const auth = req.headers.authorization;
       const auth = req.headers.authorization;
-      const firstSpace = auth.indexOf(' ');
+      const firstSpace = auth.indexOf(" ");
       if (firstSpace !== -1) {
       if (firstSpace !== -1) {
         const method = auth.slice(0, firstSpace);
         const method = auth.slice(0, firstSpace);
         const payload = auth.slice(firstSpace + 1);
         const payload = auth.slice(firstSpace + 1);
-        if (method === 'Basic') {
-          const decoded = Buffer.from(payload, 'base64').toString('utf8');
-          const colon = decoded.indexOf(':');
+        if (method === "Basic") {
+          const decoded = Buffer.from(payload, "base64").toString("utf8");
+          const colon = decoded.indexOf(":");
           if (colon !== -1) {
           if (colon !== -1) {
             const password = decoded.slice(colon + 1);
             const password = decoded.slice(colon + 1);
             const matches = await bcrypt.compare(password, link.password);
             const matches = await bcrypt.compare(password, link.password);