mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-10-02 07:21:05 +00:00
Update same site security to use origin (#1656)
Update same site security check to compare origin thank you!
This commit is contained in:
parent
36e6a426f9
commit
67b8e1edfa
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user