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
This commit is contained in:
Cory McWilliams 2023-07-31 00:26:09 +00:00
parent b5768dd927
commit bdf64edeb8
3 changed files with 3 additions and 0 deletions

View File

@ -124,6 +124,7 @@ function socket(request, response, client) {
options.credentials = credentials; options.credentials = credentials;
options.packageOwner = packageOwner; options.packageOwner = packageOwner;
options.packageName = packageName; options.packageName = packageName;
options.url = message.url;
let sessionId = makeSessionId(); let sessionId = makeSessionId();
if (blobId) { if (blobId) {
process = await core.getSessionProcessBlob(blobId, sessionId, options); process = await core.getSessionProcessBlob(blobId, sessionId, options);

View File

@ -1072,6 +1072,7 @@ function connectSocket(path) {
gSocket.send(JSON.stringify({ gSocket.send(JSON.stringify({
action: "hello", action: "hello",
path: connect_path, path: connect_path,
url: window.location.href,
api: Object.entries(k_api).map(([key, value]) => [].concat([key], value.args)), api: Object.entries(k_api).map(([key, value]) => [].concat([key], value.args)),
})); }));
} }

View File

@ -315,6 +315,7 @@ async function getProcessBlob(blobId, key, options) {
throw Error(`Permission denied: ${permission}.`); throw Error(`Permission denied: ${permission}.`);
} }
}, },
url: options?.url,
} }
}; };
if (process.credentials?.permissions?.administration) { if (process.credentials?.permissions?.administration) {