@gruu6y/page-clean-login 0.2.4 → 0.2.6
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.
- package/lib/server.mjs +12 -7
- package/package.json +1 -1
package/lib/server.mjs
CHANGED
|
@@ -2090,15 +2090,20 @@ export async function startServer({
|
|
|
2090
2090
|
"cache-control": "no-store",
|
|
2091
2091
|
"x-content-type-options": "nosniff",
|
|
2092
2092
|
"referrer-policy": "no-referrer",
|
|
2093
|
-
//
|
|
2094
|
-
//
|
|
2095
|
-
//
|
|
2096
|
-
//
|
|
2097
|
-
//
|
|
2098
|
-
//
|
|
2093
|
+
// magpie mounts this UI in `<iframe sandbox="allow-scripts">` (opaque
|
|
2094
|
+
// origin `null`). Apple WKWebView/Safari evaluates CSP `connect-src 'self'`
|
|
2095
|
+
// against that opaque origin and blocks relative `/api/*` fetches (both
|
|
2096
|
+
// desktop `wails://wails` loopback and `magpie web` reverse-proxy hosts),
|
|
2097
|
+
// so pair `'self'` with `http: https:`. `default-src 'self'`,
|
|
2098
|
+
// `object-src 'none'`, `base-uri 'none'`, and `form-action 'none'` stay
|
|
2099
|
+
// strict, and non-HTTP schemes (`ws:`, `data:`, `blob:`, `file:`) remain
|
|
2100
|
+
// blocked. No frame-ancestors: the launcher's sandboxed document is an
|
|
2101
|
+
// opaque origin and matches no ancestor source, so any list would block
|
|
2102
|
+
// magpie itself. Embedding is gated by the Sec-Fetch stub above and the
|
|
2103
|
+
// document's own embed gate instead.
|
|
2099
2104
|
"content-security-policy":
|
|
2100
2105
|
"default-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; " +
|
|
2101
|
-
"connect-src 'self'
|
|
2106
|
+
"connect-src 'self' http: https:; font-src 'self'; object-src 'none'; base-uri 'none'; " +
|
|
2102
2107
|
"form-action 'none'",
|
|
2103
2108
|
});
|
|
2104
2109
|
res.end(req.method === "HEAD" ? undefined : html);
|