From 269f9ed7d1df53d038b55825da1c150e8c81bbde Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Thu, 28 Nov 2024 14:11:55 +0100 Subject: [PATCH] wee_most.py 0.3.1: Avoid 403 on websocket connection. --- python/wee_most.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/wee_most.py b/python/wee_most.py index b5140ec8..b7d5701c 100644 --- a/python/wee_most.py +++ b/python/wee_most.py @@ -1,6 +1,9 @@ # Copyright (c) 2022 Damien Tardy-Panis # Released under the GNU GPLv3 license. # Forked from wee_matter, inspired by wee_slack +# +# Changelog: +# 0.3.1: xals - Fix missing Origin in websocket connection import json import os @@ -2535,7 +2538,7 @@ def __init__(self, server): self.last_pong_time = 0 url = server.url.replace("http", "ws", 1) + "/api/v4/websocket" - self.ws = create_connection(url) + self.ws = create_connection(url, origin=server.url) self.ws.sock.setblocking(0) params = { @@ -2829,7 +2832,7 @@ def receive_ws_callback(server_id, data): WEECHAT_SCRIPT_NAME = "wee_most" WEECHAT_SCRIPT_DESCRIPTION = "Mattermost integration" WEECHAT_SCRIPT_AUTHOR = "Damien Tardy-Panis " -WEECHAT_SCRIPT_VERSION = "0.3.0" +WEECHAT_SCRIPT_VERSION = "0.3.1" WEECHAT_SCRIPT_LICENSE = "GPL3" weechat.register(