@applitools/test-server
Advanced tools
Comparing version 1.1.22 to 1.1.23
module.exports = (req, res, next) => { | ||
const { query, cookies, method } = req; | ||
const path = req.url.includes('/images'); | ||
const requestingImage = req.url.includes(path) && method === 'GET'; | ||
if (!requestingImage && Object.keys(query).length) { | ||
res.cookie(query.name, query.value, query); | ||
if (req.query.checkCookie) { | ||
if (req.cookies[req.query.checkCookie.name] !== req.query.checkCookie.value) { | ||
return res.sendStatus(403); | ||
} | ||
} | ||
if (requestingImage && !cookies['token']) { | ||
return res.sendStatus(403); | ||
if (req.query.writeCookie) { | ||
res.cookie(req.query.writeCookie.name, req.query.writeCookie.value, req.query.writeCookie.options); | ||
} | ||
next(); | ||
}; |
@@ -12,2 +12,4 @@ 'use strict'; | ||
let { staticPath = resolve('./test/fixtures'), port = 0, allowCors, showLogs, middlewares, key, cert } = argv; | ||
if (!argv.staticPath) | ||
argv.staticPath = staticPath; | ||
const app = express(); | ||
@@ -14,0 +16,0 @@ app.use(cookieParser()); |
{ | ||
"name": "@applitools/test-server", | ||
"version": "1.1.22", | ||
"version": "1.1.23", | ||
"homepage": "https://github.com/applitools/eyes.sdk.javascript1#readme", | ||
@@ -45,4 +45,4 @@ "bugs": { | ||
"dependencies": { | ||
"@applitools/logger": "1.1.42", | ||
"@applitools/utils": "1.3.28", | ||
"@applitools/logger": "1.1.44", | ||
"@applitools/utils": "1.3.29", | ||
"body-parser": "1.20.0", | ||
@@ -76,8 +76,3 @@ "chalk": "3.0.0", | ||
"node": ">=12.0.0" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-push": "yarn bongo lint" | ||
} | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8645
542
37641
+ Added@applitools/logger@1.1.44(transitive)
+ Added@applitools/utils@1.3.29(transitive)
- Removed@applitools/logger@1.1.42(transitive)
- Removed@applitools/utils@1.3.28(transitive)
Updated@applitools/logger@1.1.44
Updated@applitools/utils@1.3.29