fix: Build absolute URLs from SITE_URL, not the request (v2.0.1)
Behind Caddy the app is reached over plain HTTP, so url_for(_external=True) produced http:// links on the https site: the RSS/OPML <link>s and the microformats u-url/u-uid permalinks that IndieWeb parsers treat as canonical. Templates now use absolute_url_for(), shared with the IndieAuth metadata. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2d0568d9c2
commit
b4e6cf3cc3
10 files changed
+91
-23
No files matched your search
@@ -681,3 +681,15 @@ def parse_iso8601(date_string: str) -> datetime:
|
||||
|
||||
# Parse using fromisoformat
|
||||
return datetime.fromisoformat(date_string)
|
||||
|
||||
|
||||
def absolute_url_for(endpoint: str, **values) -> str:
|
||||
"""
|
||||
Absolute URL for an endpoint, built from SITE_URL
|
||||
|
||||
Use instead of url_for(..., _external=True): behind a reverse proxy the
|
||||
request arrives over plain HTTP, so _external URLs would say http://.
|
||||
"""
|
||||
from flask import current_app, url_for
|
||||
|
||||
return current_app.config["SITE_URL"].rstrip("/") + url_for(endpoint, **values)
|
||||
Reference in new issue
Block a user