minor cleanups
[squeep-authentication-module] / lib / authenticator.js
index 040834fd650cd46b4d61f6b03c1acf647721d0ff..ba5d9217a86ca03efdaebd07c7b833338ddc7cce 100644 (file)
@@ -189,7 +189,7 @@ class Authenticator {
     (cookieHeader || '').split(/; */).forEach((field) => {
       const [ name, value ] = common.splitFirst(field, '=', null).map((x) => x && decodeURIComponent(x.trim()));
       if (name && !(name in cookie)) {
-        if (value && value.startsWith('"') && value.endsWith('"')) {
+        if (value?.startsWith('"') && value.endsWith('"')) {
           cookie[name] = value.slice(1, -1); // eslint-disable-line security/detect-object-injection
         } else {
           cookie[name] = value; // eslint-disable-line security/detect-object-injection