garris / garris/BackstopJS

loadCookies.js assumes cookies to be used over https

Open
#1,009 1 comment 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.2k
Forks
621
PR merge metrics
No merged PRs in 30d

Description

From the puppet loadCookies.js file:

// MUNGE COOKIE DOMAIN
cookies = cookies.map(cookie => {
cookie.url = 'https://' + cookie.domain;
delete cookie.domain;
return cookie;
});

Is it possible to add a value to the cookies.json file that indicates the use of SSL? So in your cookies.json you would have:

[
{
"domain": ".www.yourdomain.com",
"useSsl": true,
"path": "/",
"name": "yourCookieName",
"value": "yourCookieValue",
"expirationDate": 1798790400,
"hostOnly": false,
"httpOnly": false,
"secure": false,
"session": false,
"sameSite": "no_restriction"
}
]

And the fragment from loadCookies.js would then be:

// MUNGE COOKIE DOMAIN
cookies = cookies.map(cookie => {
if (cookie.useSsl) {
cookie.url = 'https://' + cookie.domain;
} else {
cookie.url = 'http://' + cookie.domain;
}
delete cookie.domain;
delete cookie.useSsl;
return cookie;
});

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.