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:
commit
aa9d834a39
2 changed files with 160 additions and 42 deletions
|
|
@ -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 '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue