aboutsummaryrefslogtreecommitdiffstats
path: root/names/server.js
diff options
context:
space:
mode:
Diffstat (limited to 'names/server.js')
-rw-r--r--names/server.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/names/server.js b/names/server.js
index 3e687c3..f12b08f 100644
--- a/names/server.js
+++ b/names/server.js
@@ -38,6 +38,7 @@ import { registrationIdentity } from './ownership.js';
import { openStore } from './store.js';
import { withdrawService } from './withdraw.js';
import { accountOf, accountBlockers, forgetAccount } from './forget.js';
+import { tolerantParams } from './lnurl-params.js';
import { migrateGrantRefusal } from './migrate-check.js';
const CFG = JSON.parse(readFileSync(process.env.NAMES_CONFIG
@@ -1333,6 +1334,8 @@ Bun.serve({
port: CFG.port || 8798,
async fetch(req, server) {
const url = new URL(req.url);
+ // "cb?domain=coinos.io?amount=…" from clients that append with a second "?"
+ if (/^\/(?:\.well-known\/)?lnurlp\//.test(url.pathname) && url.search.indexOf('?', 1) > 0) url.search = tolerantParams(url.search).toString();
if (req.method === 'OPTIONS') return json({});
const ip = req.headers.get('cf-connecting-ip') || req.headers.get('x-forwarded-for') || 'local';