Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wee_most.py 0.3.1: Avoid 403 on websocket connection. #566

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions python/wee_most.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Copyright (c) 2022 Damien Tardy-Panis <[email protected]>
# 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
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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 <[email protected]>"
WEECHAT_SCRIPT_VERSION = "0.3.0"
WEECHAT_SCRIPT_VERSION = "0.3.1"
WEECHAT_SCRIPT_LICENSE = "GPL3"

weechat.register(
Expand Down