Update same site security to use origin (#1656)

Update same site security check to compare origin

thank you!
This commit is contained in:
Adam McKay 2023-08-01 20:30:36 +01:00 committed by GitHub
parent 36e6a426f9
commit 67b8e1edfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2848,10 +2848,10 @@ return (function () {
function verifyPath(elt, path, requestConfig) {
var url = new URL(path, document.location.href);
var hostname = document.location.hostname;
var sameHost = hostname !== url.hostname;
var origin = document.location.origin;
var sameHost = origin === url.origin;
if (htmx.config.selfRequestsOnly) {
if (sameHost) {
if (!sameHost) {
return false;
}
}