From fe5b8a771276199c25a1835cbeec35517cfe9b4a Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 11 Jan 2020 03:27:21 +0100 Subject: [PATCH] Allow CORS for a fw instance --- royalpack/stars/api_discord_play.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/royalpack/stars/api_discord_play.py b/royalpack/stars/api_discord_play.py index fc29674b..680ed5e3 100644 --- a/royalpack/stars/api_discord_play.py +++ b/royalpack/stars/api_discord_play.py @@ -15,4 +15,6 @@ class ApiDiscordPlayStar(PageStar): except (ValueError, TypeError): guild_id = None response = await self.interface.call_herald_event("discord", "discord_play", url=url, guild_id=guild_id) - return JSONResponse(response) + return JSONResponse(response, headers={ + "Access-Control-Allow-Origin": self.interface.config['Funkwhale']['instance_url'], + })