From e16dbb45907e102be9fec991d4ace6e8f41a4b1d Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Sun, 21 Aug 2022 09:36:03 +0200 Subject: [PATCH] Enable CORS for the webfinger endpoint --- app/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index 19d9fb3..7d40ace 100644 --- a/app/main.py +++ b/app/main.py @@ -77,7 +77,6 @@ _RESIZED_CACHE: MutableMapping[tuple[str, int], tuple[bytes, str, Any]] = LFUCac # # Next: # - fix issue with followers from a blocked server (skip it?) -# - CORS webfinger endpoint # - allow to share old notes # - only show 10 most recent threads in DMs # - prevent double accept/double follow @@ -824,7 +823,11 @@ async def wellknown_webfinger(resource: str) -> JSONResponse: ], } - return JSONResponse(out, media_type="application/jrd+json; charset=utf-8") + return JSONResponse( + out, + media_type="application/jrd+json; charset=utf-8", + headers={"Access-Control-Allow-Origin": "*"}, + ) @app.get("/.well-known/nodeinfo")