Closed openbullet closed 2 months ago
HttpResponseBuilder
cookieValue = cookie.Substring(separatorPos + 1, endCookiePos - separatorPos - 1);
Set-Cookie: cookie-name-1=cookie-value-1; Path=/; Domain=.example.com; Secure, cookie-name-2=cookie-value-2; Path=/; Domain=.example.com; Secure
Write tests and make sure to handle edge cases:
undefined
Path=/; Domain=.example.com; Secure, undefined, Path=/; Domain=.example.com; Secure
;
=
,
Original Spec: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie Helpful SO answer with relevant context and RFCs: https://stackoverflow.com/a/2880070
HttpResponseBuilder
to prevent having negative lengthWrite tests and make sure to handle edge cases:
undefined
in the following case:Path=/; Domain=.example.com; Secure, undefined, Path=/; Domain=.example.com; Secure
;
,=
,,
? Answer: the spec disallows themOriginal Spec: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie Helpful SO answer with relevant context and RFCs: https://stackoverflow.com/a/2880070