From 7f7bcb6893e75e16ad556be9411f6922cc95fa00 Mon Sep 17 00:00:00 2001 From: lolka1333 Date: Tue, 28 Apr 2026 21:00:34 +0200 Subject: [PATCH] fix: chunk large IN ? queries and fix IPv6 same-origin check --- web/controller/websocket.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/controller/websocket.go b/web/controller/websocket.go index 1445cd04..2e9fbca0 100644 --- a/web/controller/websocket.go +++ b/web/controller/websocket.go @@ -46,9 +46,9 @@ func checkSameOrigin(r *http.Request) bool { } host, _, err := net.SplitHostPort(r.Host) if err != nil { - // IPv6 literal без порта приходит как "[::1]" — net.SplitHostPort - // в этом случае ошибается, а url.Hostname() возвращает адрес без - // скобок. Снимаем их вручную, чтобы same-origin не отказывал на IPv6. + // IPv6 literals without a port arrive as "[::1]"; net.SplitHostPort + // fails in that case while url.Hostname() returns the address without + // brackets. Strip them so same-origin checks pass for bare IPv6 hosts. host = r.Host if len(host) >= 2 && host[0] == '[' && host[len(host)-1] == ']' { host = host[1 : len(host)-1]