summaryrefslogtreecommitdiff
path: root/packages/backend/src/core
diff options
context:
space:
mode:
authorMarie <github@yuugi.dev>2025-05-08 16:09:15 +0000
committerMarie <github@yuugi.dev>2025-05-08 16:09:15 +0000
commitaa9d834a398c54cf1c755cc64ffe374ec2e4d4a4 (patch)
tree6798d7cf46eae6b9b679f1298b05e28b790a2cdc /packages/backend/src/core
parentmerge: add `scheduleNotePost` queue to dashboard (!994) (diff)
parentfix return type of fetchSummary and fetchSummaryFromProxy (diff)
downloadsharkey-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.ts10
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 '';
+ }
+ }
}