Skip to content

Commit

Permalink
Strip protocol before feeding just the outgoing domain to the manifes…
Browse files Browse the repository at this point in the history
…t API

Signed-off-by: Arun <[email protected]>
  • Loading branch information
arunsathiya committed Nov 20, 2023
1 parent fef25e8 commit 3ccea37
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/manifest/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down

0 comments on commit 3ccea37

Please sign in to comment.