From f2735e62759fef780d8c25dbeac6bee90ad43713 Mon Sep 17 00:00:00 2001 From: Armin Date: Mon, 25 Mar 2019 15:33:53 +0100 Subject: [PATCH] Use host instead of hostname --- backend/src/activitypub/ActivityPub.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/backend/src/activitypub/ActivityPub.js b/backend/src/activitypub/ActivityPub.js index 52ad8a91c..f01ae145a 100644 --- a/backend/src/activitypub/ActivityPub.js +++ b/backend/src/activitypub/ActivityPub.js @@ -33,9 +33,7 @@ export default class ActivityPub { if (!activityPub) { dotenv.config() const url = new URL(process.env.GRAPHQL_URI) - // TODO Check why the hostname attribute in the prod env not containing the tld! Following line is a quick fix!! - const hostname = url.hostname.endsWith('.org') || url.hostname.indexOf('localhost') > -1 ? url.hostname : url.hostname.concat('.org') - activityPub = new ActivityPub(hostname || 'localhost', url.port || 4000, url.origin) + activityPub = new ActivityPub(url.host || 'localhost', url.port || 4000, url.origin) // integrate into running graphql express server server.express.set('ap', activityPub)