From bcee1c8dc8c06faf8278f65484e1c12e3738233a Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 8 Aug 2023 14:30:15 -0400 Subject: [PATCH] fix: incorrect host/hostname usage in well-known test --- test/controllers.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/controllers.js b/test/controllers.js index bd53d7c312..8a6ba3e204 100644 --- a/test/controllers.js +++ b/test/controllers.js @@ -2849,7 +2849,7 @@ describe('Controllers', () => { it('should deny access if view:users privilege is not enabled for guests', async () => { await privileges.global.rescind(['groups:view:users'], 'guests'); - const response = await requestAsync(`${nconf.get('url')}/.well-known/webfinger?resource=acct:${username}@${nconf.get('url_parsed').hostname}`, { + const response = await requestAsync(`${nconf.get('url')}/.well-known/webfinger?resource=acct:${username}@${nconf.get('url_parsed').host}`, { json: true, simple: false, resolveWithFullResponse: true, @@ -2861,7 +2861,7 @@ describe('Controllers', () => { }); it('should respond appropriately if the user requested does not exist locally', async () => { - const response = await requestAsync(`${nconf.get('url')}/.well-known/webfinger?resource=acct:foobar@${nconf.get('url_parsed').hostname}`, { + const response = await requestAsync(`${nconf.get('url')}/.well-known/webfinger?resource=acct:foobar@${nconf.get('url_parsed').host}`, { json: true, simple: false, resolveWithFullResponse: true, @@ -2871,7 +2871,7 @@ describe('Controllers', () => { }); it('should return a valid webfinger response if the user exists', async () => { - const response = await requestAsync(`${nconf.get('url')}/.well-known/webfinger?resource=acct:${username}@${nconf.get('url_parsed').hostname}`, { + const response = await requestAsync(`${nconf.get('url')}/.well-known/webfinger?resource=acct:${username}@${nconf.get('url_parsed').host}`, { json: true, simple: false, resolveWithFullResponse: true, @@ -2879,7 +2879,7 @@ describe('Controllers', () => { assert.strictEqual(response.statusCode, 200); assert(['subject', 'aliases', 'links'].every(prop => response.body.hasOwnProperty(prop))); - assert(response.body.subject, `acct:${username}@${nconf.get('url_parsed').hostname}`); + assert(response.body.subject, `acct:${username}@${nconf.get('url_parsed').host}`); }); }); });