mirror of
https://github.com/mempool/mempool.git
synced 2026-08-13 12:33:11 +02:00
Update frontend/src/app/components/twitter-widget/twitter-widget.component.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
d8c4b99c13
commit
843b652510
1 changed files with 5 additions and 1 deletions
|
|
@ -40,7 +40,11 @@ export class TwitterWidgetComponent implements OnChanges {
|
|||
if (!this.handle) {
|
||||
return;
|
||||
}
|
||||
const url = `https://${this.stateService.env.TWIDGET_DOMAIN}/api/v1/social/x/${this.handle}`;
|
||||
const baseOrigin = this.stateService.env.TWIDGET_DOMAIN;
|
||||
const normalizedOrigin = baseOrigin && !/^https?:\/\//i.test(baseOrigin)
|
||||
? `https://${baseOrigin}`
|
||||
: baseOrigin;
|
||||
const url = new URL(`/api/v1/social/x/${this.handle}`, normalizedOrigin).toString();
|
||||
this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.sanitizer.sanitize(SecurityContext.URL, url));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue