{"draft":null,"from":116,"to":318,"files":[{"path":"client/src/core.ts","added":31,"removed":5,"diff":"--- a/client/src/core.ts\n+++ b/client/src/core.ts\n@@ -107,6 +107,22 @@\n }\n \n /**\n+ * A server's base: its origin and any path, without a trailing slash (https://x.example/issues), or undefined\n+ * for anything else, a query, a fragment or a user name included. Plain string work, as serverOrigin.\n+ */\n+export function serverBase(s: string): string | undefined {\n+\tconst m = /^(https?):\\/\\/([^/?#\\\\]+)((?:\\/[^?#\\\\]*)?)$/i.exec(s.trim());\n+\tif (!m || m[2]!.includes(\"@\")) return undefined;\n+\treturn `${m[1]!.toLowerCase()}://${m[2]!.toLowerCase()}${m[3]!.replace(/\\/+$/, \"\")}`;\n+}\n+\n+/** The origin of a server given with or without a path (serverBase), or undefined. */\n+export function baseOrigin(s: string): string | undefined {\n+\tconst base = serverBase(s);\n+\treturn base === undefined ? undefined : serverOrigin(base.replace(/^(https?:\\/\\/[^/]+).*$/i, \"$1\"));\n+}\n+\n+/**\n  * This machine's servers, from ~/.abso/servers.json:\n  * {\"servers\": {\"<server>\": {\"issues\": \"<its Issues Worker>\"}}}. Each server\n  * named there, and each Issues Worker it names, may receive the token, and a\n@@ -130,10 +146,10 @@\n \t\t\t\tif (o === undefined) continue;\n \t\t\t\ttrusted.push(o);\n \t\t\t\tconst i = (about as { issues?: unknown } | null)?.issues;\n-\t\t\t\tconst io = typeof i === \"string\" ? serverOrigin(i) : undefined;\n+\t\t\t\tconst io = typeof i === \"string\" ? serverBase(i) : undefined;\n \t\t\t\tif (io !== undefined) {\n \t\t\t\t\tissues[o] = io;\n-\t\t\t\t\ttrusted.push(io);\n+\t\t\t\t\ttrusted.push(baseOrigin(io)!);\n \t\t\t\t}\n \t\t\t}\n \t} catch {}\n@@ -146,14 +162,24 @@\n }\n \n /**\n- * The Issues Worker beside an avcs server (#54): this machine's servers.json\n- * first, then abso's own. ABSO_ISSUES_SERVER overrides both (issues.ts).\n+ * The Issues Worker beside an avcs server: this machine's servers.json\n+ * first, then abso's own, else the server's own /issues, where the open\n+ * server keeps them. ABSO_ISSUES_SERVER overrides all three (issues.ts).\n  */\n export function issuesServerFor(server: string, machine?: MachineServers): string | undefined {\n \tconst o = serverOrigin(server);\n-\treturn o === undefined ? undefined : (machine?.issues[o] ?? ISSUES_SERVERS[o]);\n+\treturn o === undefined ? undefined : (machine?.issues[o] ?? ISSUES_SERVERS[o] ?? `${o}/issues`);\n }\n \n+/**\n+ * Whether the token may go to an Issues Worker: as to its origin (tokenGoesTo), since it may sit at a path on\n+ * its server, as the open server's do at <server>/issues. A query, a fragment or a user name is refused.\n+ */\n+export function tokenGoesToIssues(server: string, trusted?: string): boolean {\n+\tconst o = baseOrigin(server);\n+\treturn o !== undefined && tokenGoesTo(o, trusted);\n+}\n+\n /** Whether the token may go to `server`: TOKEN_SERVERS, `trusted` (trustedList), or this machine. Plain string work: the mod has no URL. */\n export function tokenGoesTo(server: string, trusted?: string): boolean {\n \tconst origin = serverOrigin;"}],"unmatched":[]}