You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (cookie.name.startsWithIgnoringASCIICase("__Host-"_s)) {
446
-
if (!options.domain.isNull()) {
447
-
promise->reject(Exception { ExceptionCode::TypeError, "If the cookie name begins with \"__Host-\", the domain must not be specified."_s });
448
-
return;
449
-
}
450
-
451
-
if (!options.path.isNull() && options.path != "/"_s) {
452
-
promise->reject(Exception { ExceptionCode::TypeError, "If the cookie name begins with \"__Host-\", the path must either not be specified or be \"/\"."_s });
promise->reject(Exception { ExceptionCode::TypeError, "The path must begin with a '/'"_s });
491
-
return;
492
-
}
481
+
ASSERT(!cookie.path.isNull());
482
+
if (cookie.path.isEmpty())
483
+
cookie.path = url.path().toString();
493
484
494
-
// FIXME: <rdar://85515842> Obtain the encoded length without allocating and encoding.
495
-
if (cookie.path.utf8().length() > maximumAttributeValueSize) {
496
-
promise->reject(Exception { ExceptionCode::TypeError, makeString("The size of the path must not be greater than "_s, maximumAttributeValueSize, " bytes"_s) });
497
-
return;
498
-
}
485
+
if (!cookie.path.startsWith('/')) {
486
+
promise->reject(Exception { ExceptionCode::TypeError, "The path must begin with a '/'"_s });
487
+
return;
488
+
}
489
+
490
+
if (options.path != "/"_s && cookie.name.startsWithIgnoringASCIICase("__Host-"_s)) {
491
+
promise->reject(Exception { ExceptionCode::TypeError, "If the cookie name begins with \"__Host-\", the path must either not be specified or be \"/\"."_s });
492
+
return;
493
+
}
494
+
495
+
// FIXME: <rdar://85515842> Obtain the encoded length without allocating and encoding.
496
+
if (cookie.path.utf8().length() > maximumAttributeValueSize) {
497
+
promise->reject(Exception { ExceptionCode::TypeError, makeString("The size of the path must not be greater than "_s, maximumAttributeValueSize, " bytes"_s) });
0 commit comments