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>
This commit is contained in:
@@ -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 '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user