Unconditionally send Access-Control-Allow-Private-Network, fix LNA fix in GUI

This commit is contained in:
ProgrammerIn-wonderland
2026-05-07 19:18:52 -04:00
parent 8d5e9ef9cf
commit a5dff457ae
2 changed files with 2 additions and 7 deletions
+1 -6
View File
@@ -622,12 +622,7 @@ export class PuterServer {
res.setHeader('Access-Control-Allow-Methods', allowedMethods);
res.setHeader('Access-Control-Allow-Headers', allowedHeaders);
// Private Network Access: grant public origins permission to
// reach loopback/private addresses (e.g. self-hosted Puter on
// localhost, or api.puter.com pointed at a local IP via hosts).
if (req.headers['access-control-request-private-network']) {
res.setHeader('Access-Control-Allow-Private-Network', 'true');
}
res.setHeader('Access-Control-Allow-Private-Network', 'true');
// Disable iframes on the main domain
if (req.hostname === config.domain) {
+1 -1
View File
@@ -407,7 +407,7 @@ async function UIWindow (options) {
style="${!options.has_head ? ' height: 100%;' : ''}">`;
// iframe, for apps
if ( options.iframe_url || options.iframe_srcdoc ) {
let allow_str = 'screen-wake-lock; picture-in-picture; document-picture-in-picture; camera; encrypted-media; gamepad; display-capture; geolocation; gyroscope; microphone; midi; clipboard-read; clipboard-write; fullscreen; web-share; file-system-handle; local-storage; downloads; autoplay;';
let allow_str = 'screen-wake-lock; picture-in-picture; document-picture-in-picture; camera; encrypted-media; gamepad; display-capture; geolocation; gyroscope; microphone; midi; clipboard-read; clipboard-write; fullscreen; web-share; file-system-handle; local-storage; downloads; autoplay; local-network-access;';
if ( window.co_isolation_enabled )
{
allow_str += ' cross-origin-isolated;';