From 3ccea37c4ab6e9576b55e40d005d6c4018e24b06 Mon Sep 17 00:00:00 2001 From: Arun Date: Mon, 20 Nov 2023 15:46:58 -0800 Subject: [PATCH] Strip protocol before feeding just the outgoing domain to the manifest API Signed-off-by: Arun --- src/manifest/mod.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/manifest/mod.ts b/src/manifest/mod.ts index 5677e7f7..ad94589b 100644 --- a/src/manifest/mod.ts +++ b/src/manifest/mod.ts @@ -132,7 +132,13 @@ export class SlackManifest { ); } - manifest.outgoing_domains = def.outgoingDomains || []; + manifest.outgoing_domains = (def.outgoingDomains || []).map((domain) => { + try { + return new URL(domain).hostname; + } catch (e) { + throw new Error(`Invalid outgoing domain: ${domain}, error ${e}`); + } + }); // Assign remote hosted app properties if (manifest.settings.function_runtime === "slack") {