Improve `set-cookie.fn` scriptlet

As per browser behavior, space character does not require encoding.
This commit is contained in:
Raymond Hill 2024-04-10 08:24:45 -04:00
parent 581c2824d0
commit 89fa666bc4
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 1 additions and 1 deletions

View File

@ -977,7 +977,7 @@ function setCookieFn(
// https://datatracker.ietf.org/doc/html/rfc6265#section-4.1.1
// The characters [",] are given a pass from the RFC requirements because
// apparently browsers do not follow the RFC to the letter.
if ( /[^!-:<-[\]-~]/.test(value) ) {
if ( /[^ -:<-[\]-~]/.test(value) ) {
value = encodeURIComponent(value);
}