Some checks failed
Deploy with Docker Compose / deploy (push) Has been cancelled
The CheckOrigin function only accepted the production domain, rejecting localhost connections in dev. Also removed redundant error response after a failed upgrade since the upgrader already writes its own HTTP response. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
17 lines
355 B
Go
17 lines
355 B
Go
package handlers
|
|
|
|
import (
|
|
"adam-french.co.uk/backend/services"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func (store *Store) ConnectWebSocket(ctx *gin.Context) {
|
|
conn, err := services.Upgrader.Upgrade(ctx.Writer, ctx.Request, nil)
|
|
if err != nil {
|
|
// Upgrader already wrote the HTTP error response, so just return
|
|
return
|
|
}
|
|
|
|
services.HandleWebSocket(conn)
|
|
}
|