diff options
| author | Marie <github@yuugi.dev> | 2025-05-08 16:09:15 +0000 |
|---|---|---|
| committer | Marie <github@yuugi.dev> | 2025-05-08 16:09:15 +0000 |
| commit | aa9d834a398c54cf1c755cc64ffe374ec2e4d4a4 (patch) | |
| tree | 6798d7cf46eae6b9b679f1298b05e28b790a2cdc /packages/backend/src/core | |
| parent | merge: add `scheduleNotePost` queue to dashboard (!994) (diff) | |
| parent | fix return type of fetchSummary and fetchSummaryFromProxy (diff) | |
| download | sharkey-aa9d834a398c54cf1c755cc64ffe374ec2e4d4a4.tar.gz sharkey-aa9d834a398c54cf1c755cc64ffe374ec2e4d4a4.tar.bz2 sharkey-aa9d834a398c54cf1c755cc64ffe374ec2e4d4a4.zip | |
merge: Improve inline quote detection and link previews (resolves #1047 and #1044) (!985)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/985
Closes #1047 and #1044
Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Marie <github@yuugi.dev>
Diffstat (limited to 'packages/backend/src/core')
| -rw-r--r-- | packages/backend/src/core/UtilityService.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/backend/src/core/UtilityService.ts b/packages/backend/src/core/UtilityService.ts index f8d04c0592..170afc72dc 100644 --- a/packages/backend/src/core/UtilityService.ts +++ b/packages/backend/src/core/UtilityService.ts @@ -176,4 +176,14 @@ export class UtilityService { const host = this.extractDbHost(uri); return this.isFederationAllowedHost(host); } + + @bindThis + public getUrlScheme(url: string): string { + try { + // Returns in the format "https:" or an empty string + return new URL(url).protocol; + } catch { + return ''; + } + } } |