From 3cff4e4507509696ce8fa64828043cdaa0ba9ead Mon Sep 17 00:00:00 2001 From: Kevin Wallace Date: Thu, 17 Nov 2022 21:35:02 -0800 Subject: [PATCH] Use BASE_URL when generating {proxied,resized}_image_url Necessary when running at a non-root path --- app/actor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/actor.py b/app/actor.py index ecf53f1..271b88b 100644 --- a/app/actor.py +++ b/app/actor.py @@ -12,6 +12,7 @@ from sqlalchemy.orm import joinedload from app import activitypub as ap from app import media +from app.config import BASE_URL from app.database import AsyncSession from app.utils.datetime import as_utc from app.utils.datetime import now @@ -111,14 +112,14 @@ class Actor: if self.icon_url: return media.proxied_media_url(self.icon_url) else: - return "/static/nopic.png" + return BASE_URL + "/static/nopic.png" @property def resized_icon_url(self) -> str: if self.icon_url: return media.resized_media_url(self.icon_url, 50) else: - return "/static/nopic.png" + return BASE_URL + "/static/nopic.png" @property def tags(self) -> list[ap.RawObject]: