1
0
mirror of https://github.com/taigrr/log-socket synced 2026-03-21 00:12:19 -07:00

test(ws,browser): add test suites for ws and browser packages

- Add ws/server_test.go: WebSocket connection, namespace filtering, non-upgrade rejection, SetUpgrader
- Add ws/namespaces_test.go: NamespacesHandler response format and content
- Add browser/browser_test.go: template rendering, ws URL construction, trailing slash handling
- Fix goimports whitespace in ws/server.go
This commit is contained in:
2026-03-07 11:33:59 +00:00
parent 99882832c0
commit 38cee1fb42
4 changed files with 243 additions and 1 deletions

View File

@@ -23,7 +23,7 @@ func LogSocketHandler(w http.ResponseWriter, r *http.Request) {
if namespacesParam != "" {
namespaces = strings.Split(namespacesParam, ",")
}
c, err := upgrader.Upgrade(w, r, nil)
if err != nil {
logger.Error("upgrade:", err)