From dce86b1f4c37a6eaec2751b61dd16397cf9e7ec0 Mon Sep 17 00:00:00 2001 From: saturn Date: Sun, 22 May 2022 03:23:46 -0500 Subject: [PATCH] Add origin-agent-cluster header to allow document.domain in Chrome. --- lw2.lisp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lw2.lisp b/lw2.lisp index 0860d4aa..d0eabdea 100644 --- a/lw2.lisp +++ b/lw2.lisp @@ -558,7 +558,7 @@ signaled condition to *HTML-OUTPUT*." (with-delimited-writer (out-stream delimit :begin "") (when site-domain (delimit) - (set-script-variables ("document.domain" site-domain))) + (set-script-variables ("document.domain" site-domain))) ; Requires origin-agent-cluster header, see below (unless preview (delimit) (when (typep *current-site* 'login-site) @@ -792,6 +792,8 @@ signaled condition to *HTML-OUTPUT*." (values t nil))) (when (not *revalidate-default*) (setf (hunchentoot:header-out :cache-control) (format nil "public, max-age=~A" (* 5 60)))) + (when (site-domain *current-site*) + (setf (hunchentoot:header-out :origin-agent-cluster) "?0")) ; Allow document.domain in Chrome: https://developer.chrome.com/blog/immutable-document-domain/ (let ((*memoized-output-without-hyphens* ;; Soft hyphen characters mess up middle-click paste and screen readers, so try to identify whether they are necessary. ;; See https://caniuse.com/?search=hyphens -- 2.11.4.GIT