happy-dom 9.1.9 → 9.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of happy-dom might be problematic. Click here for more details.
- package/lib/cookie/Cookie.d.ts +18 -28
- package/lib/cookie/Cookie.d.ts.map +1 -1
- package/lib/cookie/Cookie.js +56 -83
- package/lib/cookie/Cookie.js.map +1 -1
- package/lib/cookie/CookieJar.d.ts +9 -13
- package/lib/cookie/CookieJar.d.ts.map +1 -1
- package/lib/cookie/CookieJar.js +41 -49
- package/lib/cookie/CookieJar.js.map +1 -1
- package/lib/cookie/CookieSameSiteEnum.d.ts +7 -0
- package/lib/cookie/CookieSameSiteEnum.d.ts.map +1 -0
- package/lib/cookie/CookieSameSiteEnum.js +10 -0
- package/lib/cookie/CookieSameSiteEnum.js.map +1 -0
- package/lib/fetch/Fetch.d.ts.map +1 -1
- package/lib/fetch/Fetch.js +2 -6
- package/lib/fetch/Fetch.js.map +1 -1
- package/lib/nodes/document/Document.js +2 -2
- package/lib/nodes/document/Document.js.map +1 -1
- package/lib/xml-http-request/XMLHttpRequest.d.ts.map +1 -1
- package/lib/xml-http-request/XMLHttpRequest.js +4 -3
- package/lib/xml-http-request/XMLHttpRequest.js.map +1 -1
- package/package.json +1 -1
- package/src/cookie/Cookie.ts +58 -91
- package/src/cookie/CookieJar.ts +52 -53
- package/src/cookie/CookieSameSiteEnum.ts +6 -0
- package/src/fetch/Fetch.ts +6 -8
- package/src/nodes/document/Document.ts +2 -2
- package/src/xml-http-request/XMLHttpRequest.ts +7 -3
@@ -558,7 +558,7 @@ export default class XMLHttpRequest extends XMLHttpRequestEventTarget {
|
|
558
558
|
accept: '*/*',
|
559
559
|
referer: location.href,
|
560
560
|
'user-agent': navigator.userAgent,
|
561
|
-
cookie: document.
|
561
|
+
cookie: document._cookie.getCookieString(location, false)
|
562
562
|
};
|
563
563
|
}
|
564
564
|
|
@@ -973,13 +973,17 @@ export default class XMLHttpRequest extends XMLHttpRequestEventTarget {
|
|
973
973
|
* @param headers String array.
|
974
974
|
*/
|
975
975
|
private _setCookies(headers: string[] | HTTP.IncomingHttpHeaders): void {
|
976
|
+
const originURL = new URL(this._settings.url, this._ownerDocument.defaultView.location);
|
976
977
|
for (const header of ['set-cookie', 'set-cookie2']) {
|
977
978
|
if (Array.isArray(headers[header])) {
|
978
979
|
for (const cookie of headers[header]) {
|
979
|
-
this._ownerDocument.defaultView.document._cookie.
|
980
|
+
this._ownerDocument.defaultView.document._cookie.addCookieString(originURL, cookie);
|
980
981
|
}
|
981
982
|
} else if (headers[header]) {
|
982
|
-
this._ownerDocument.defaultView.document._cookie.
|
983
|
+
this._ownerDocument.defaultView.document._cookie.addCookieString(
|
984
|
+
originURL,
|
985
|
+
headers[header]
|
986
|
+
);
|
983
987
|
}
|
984
988
|
}
|
985
989
|
}
|