Implements CONSOLE_DEV_MODE env var (#2517)

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
This commit is contained in:
Alex
2022-12-16 13:32:52 -06:00
committed by GitHub
parent f917f7d167
commit f61d0a68d5
3 changed files with 11 additions and 4 deletions

View File

@@ -148,10 +148,12 @@ func serveWS(w http.ResponseWriter, req *http.Request) {
return
}
// Un-comment for development so websockets work on port 5005
/*upgrader.CheckOrigin = func(r *http.Request) bool {
return true
}*/
// Development mode validation
if getConsoleDevMode() {
upgrader.CheckOrigin = func(r *http.Request) bool {
return true
}
}
// upgrades the HTTP server connection to the WebSocket protocol.
conn, err := upgrader.Upgrade(w, req, nil)