@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.
Files changed (2) hide show
  1. package/lib/server.mjs +12 -7
  2. 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
- // Same-origin assets and API calls only; connect-src "'self'"
2094
- // already covers the relative /api/* fetches the page makes. No
2095
- // frame-ancestors: the launcher's sandboxed document is an opaque
2096
- // origin and matches no ancestor source, so any list would block
2097
- // magpie itself. Embedding is gated by the Sec-Fetch stub above
2098
- // and the document's own embed gate instead.
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'; font-src 'self'; object-src 'none'; base-uri 'none'; " +
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gruu6y/page-clean-login",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "在 magpie 中管理代理 IP 与供应商登录,每个账号通过独立浏览器身份登录;一个带仅回环主机服务的页面插件。",
5
5
  "license": "MIT",
6
6
  "publishConfig": {