allow overriding origin from workers.dev on mcp server (#3204)
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
Notify HeyPuter / notify (push) Has been cancelled
release-please / release-please (push) Has been cancelled

This commit is contained in:
ProgrammerIn-wonderland
2026-06-03 17:48:37 -04:00
committed by GitHub
parent 2387d8dcc9
commit 07781cd681
2 changed files with 10 additions and 2 deletions
+8 -1
View File
@@ -29,7 +29,14 @@ const guiOrigin = () => globalThis.puter_gui_origin || DEFAULT_GUI_ORIGIN;
const secretString = () =>
globalThis.OAUTH_SECRET || 'puter-mcp-dev-insecure-secret-change-me';
const originOf = (request) => new URL(request.url).origin;
const originOf = (request) => {
let originalOrigin = new URL(request.url).origin;
if (originalOrigin.includes('workers.dev') && globalThis.OVERRIDE_ORIGIN) {
return globalThis.OVERRIDE_ORIGIN;
}
return originalOrigin;
};
// ---- base64url + AES-GCM sealing ------------------------------------------
+2 -1
View File
@@ -16,7 +16,8 @@ no_bundle = true
# puter_endpoint - Puter API origin for fs/subdomain calls (default https://api.puter.com)
# puter_gui_origin - Puter GUI origin for the OAuth "Sign in with Puter"
# (authme) redirect (default https://puter.com)
# [vars]
[vars]
# OVERRIDE_ORIGIN = "https://mcp.puter.com"
# puter_endpoint = "https://api.puter.com"
# puter_gui_origin = "https://puter.com"