From caa03a63e65c852263e9a13020c18faae2dc6680 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Wed, 28 Feb 2024 12:54:34 -0500 Subject: [PATCH] fix(pterodactyl): set origin header through websockets.connect and not through extra_headers --- pterodactyl/pterodactyl.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pterodactyl/pterodactyl.py b/pterodactyl/pterodactyl.py index bd1bb95..918ca90 100644 --- a/pterodactyl/pterodactyl.py +++ b/pterodactyl/pterodactyl.py @@ -34,10 +34,6 @@ class Pterodactyl(commands.Cog): api_key = await self.config.api_key() server_id = await self.config.server_id() - extra_headers = { - "origin": base_url - } - try: client = PterodactylClient(base_url, api_key, debug=True).client websocket_credentials = client.servers.get_websocket(server_id) @@ -49,7 +45,7 @@ class Pterodactyl(commands.Cog): self.logger.error('Failed to retrieve Pterodactyl websocket: %s', e) return - async for websocket in websockets.connect(websocket_credentials['data']['socket'], extra_headers=extra_headers): + async for websocket in websockets.connect(websocket_credentials['data']['socket'], origin=base_url): try: self.logger.debug("WebSocket connection established")