MCPcopy Create free account
hub / github.com/angular/dev-infra / parseSetCookie

Function parseSetCookie

github-actions/browserstack/set-browserstack-env.js:16640–16675  ·  view source on GitHub ↗
(header)

Source from the content-addressed store, hash-verified

16638 //
16639 var require_util6 = __commonJS({
16640 ""(exports, module) {
16641 "use strict";
16642 function isCTLExcludingHtab(value) {
16643 for (let i = 0; i < value.length; ++i) {
16644 const code = value.charCodeAt(i);
16645 if (code >= 0 && code <= 8 || code >= 10 && code <= 31 || code === 127) {
16646 return true;
16647 }
16648 }
16649 return false;
16650 }
16651 function validateCookieName(name) {
16652 for (let i = 0; i < name.length; ++i) {
16653 const code = name.charCodeAt(i);
16654 if (code < 33 || // exclude CTLs (0-31), SP and HT
16655 code > 126 || // exclude non-ascii and DEL
16656 code === 34 || // "
16657 code === 40 || // (
16658 code === 41 || // )
16659 code === 60 || // <
16660 code === 62 || // >
16661 code === 64 || // @
16662 code === 44 || // ,
16663 code === 59 || // ;
16664 code === 58 || // :
16665 code === 92 || // \
16666 code === 47 || // /
16667 code === 91 || // [
16668 code === 93 || // ]
16669 code === 63 || // ?
16670 code === 61 || // =
16671 code === 123 || // {
16672 code === 125) {
16673 throw new Error("Invalid cookie name");
16674 }
16675 }
16676 }
16677 function validateCookieValue(value) {
16678 let len = value.length;

Callers 1

getSetCookiesFunction · 0.70

Calls 5

isCTLExcludingHtabFunction · 0.70
__spreadValuesFunction · 0.70
parseUnparsedAttributesFunction · 0.70
sliceMethod · 0.45

Tested by

no test coverage detected