From bdf64edeb8b07065c6b244db2c180b534991afa8 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Mon, 31 Jul 2023 00:26:09 +0000 Subject: [PATCH] Expose the client's requesting URL to apps. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4374 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- core/app.js | 1 + core/client.js | 1 + core/core.js | 1 + 3 files changed, 3 insertions(+) diff --git a/core/app.js b/core/app.js index 9d9a4e0e..d08df01a 100644 --- a/core/app.js +++ b/core/app.js @@ -124,6 +124,7 @@ function socket(request, response, client) { options.credentials = credentials; options.packageOwner = packageOwner; options.packageName = packageName; + options.url = message.url; let sessionId = makeSessionId(); if (blobId) { process = await core.getSessionProcessBlob(blobId, sessionId, options); diff --git a/core/client.js b/core/client.js index 38571cb8..c360809a 100644 --- a/core/client.js +++ b/core/client.js @@ -1072,6 +1072,7 @@ function connectSocket(path) { gSocket.send(JSON.stringify({ action: "hello", path: connect_path, + url: window.location.href, api: Object.entries(k_api).map(([key, value]) => [].concat([key], value.args)), })); } diff --git a/core/core.js b/core/core.js index 913cd074..83fd4879 100644 --- a/core/core.js +++ b/core/core.js @@ -315,6 +315,7 @@ async function getProcessBlob(blobId, key, options) { throw Error(`Permission denied: ${permission}.`); } }, + url: options?.url, } }; if (process.credentials?.permissions?.administration) {