MCPcopy Create free account
hub / github.com/nodejs/node / validateCookiePath

Function validateCookiePath

deps/undici/src/lib/web/cookies/util.js:102–114  ·  view source on GitHub ↗

* path-value = * @param {string} path

(path)

Source from the content-addressed store, hash-verified

100 * @param {string} path
101 */
102function validateCookiePath (path) {
103 for (let i = 0; i < path.length; ++i) {
104 const code = path.charCodeAt(i)
105
106 if (
107 code < 0x20 || // exclude CTLs (0-31)
108 code === 0x7F || // DEL
109 code === 0x3B // ;
110 ) {
111 throw new Error('Invalid cookie path')
112 }
113 }
114}
115
116/**
117 * I have no idea why these values aren't allowed to be honest,

Callers 1

stringifyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected