Chore: Toggle websocket compression using HTTP compression setting

This commit is contained in:
Ralph Slooten
2026-06-12 20:33:59 +12:00
parent 8747cd81f9
commit 2db18f671f

View File

@@ -8,6 +8,7 @@ import (
"net/http"
"time"
"github.com/axllent/mailpit/config"
"github.com/axllent/mailpit/internal/auth"
"github.com/axllent/mailpit/internal/logger"
"github.com/gorilla/websocket"
@@ -32,7 +33,7 @@ var (
var upgrader = websocket.Upgrader{
ReadBufferSize: 1024,
WriteBufferSize: 1024,
EnableCompression: true,
EnableCompression: !config.DisableHTTPCompression,
CheckOrigin: func(_ *http.Request) bool {
// origin is checked via server.go's CORS settings
return true