Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(manifest): Strip protocol before feeding just the outgoing domain to the manifest API #246

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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