From 64596f863d20a80fbc49a9ba92505fb4fb01e3f5 Mon Sep 17 00:00:00 2001 From: Tony Stipanic Date: Wed, 1 Sep 2021 00:01:32 +0200 Subject: [PATCH] Revert "Use integrated URL instead of split-host" This reverts commit dc54c50c39e98baacf128c10c09109abae173be0. --- package-lock.json | 5 +++++ package.json | 3 ++- src/matrix/helpers.ts | 9 +++++---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index dd35d96..d6b795b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15497,6 +15497,11 @@ "integrity": "sha512-oYBGY0GV1H1dX+ZdKnB6JVsYC1w/Xl20H111eb+WSS8nUYmlHgGb4y5buFSkzzceEeYYh5kMhXoAmoTpiQauiA==", "dev": true }, + "split-host": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/split-host/-/split-host-0.1.1.tgz", + "integrity": "sha512-nrlaPJMHkr3hKx7aCyr+S0OgUvAm/xKzWWMHej0IsMamWjRC52Fv+NGZwuqRE1lyu1iNWCmcrpZ1S1qvk+Uiwg==" + }, "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", diff --git a/package.json b/package.json index a957b4a..53a70eb 100644 --- a/package.json +++ b/package.json @@ -73,6 +73,7 @@ "sequelize": "6.6.2", "sequelize-typescript": "^2.1.0", "sharp": "^0.29.0", + "split-host": "^0.1.1", "spotify-uri": "^2.2.0", "sqlite3": "^5.0.2", "telegraf": "^4.4.1", @@ -142,4 +143,4 @@ "webpack-cli": "^4.8.0", "webpack-dev-server": "^4.0.0" } -} +} \ No newline at end of file diff --git a/src/matrix/helpers.ts b/src/matrix/helpers.ts index 707d4d5..1aa58cd 100644 --- a/src/matrix/helpers.ts +++ b/src/matrix/helpers.ts @@ -3,6 +3,7 @@ import { LogService } from "matrix-js-snippets"; import { Cache, CACHE_FEDERATION } from "../MemoryCache"; import * as request from "request"; import config from "../config"; +import splitHost from 'split-host'; import * as requestPromise from "request-promise"; import { isIP } from "net"; @@ -36,12 +37,12 @@ export async function getFederationConnInfo(serverName: string): Promise