Skip to content

Commit

Permalink
add null value guard to concatCookieNameValuePath
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislav-atr committed Nov 7, 2022
1 parent 69367ab commit e7c6566
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/helpers/cookie-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ export const getCookiePath = (rawPath) => {
*/
export const concatCookieNameValuePath = (rawName, rawValue, rawPath) => {
const log = console.log.bind(console); // eslint-disable-line no-console
if (rawValue === null) {
log(`Invalid cookie value: '${rawValue}'`);
return null;
}
if (!isValidCookieRawPath(rawPath)) {
log(`Invalid cookie path: '${rawPath}'`);
return null;
Expand Down

0 comments on commit e7c6566

Please sign in to comment.