diff --git a/main.go b/main.go index c693d60..67325e8 100644 --- a/main.go +++ b/main.go @@ -8,6 +8,7 @@ import ( "clickandjoin.app/websocketserver/modules/rabbitmq" "clickandjoin.app/websocketserver/modules/scylladb" "clickandjoin.app/websocketserver/modules/structs" + "clickandjoin.app/websocketserver/modules/utils" "clickandjoin.app/websocketserver/socketserver" "github.com/gofiber/fiber/v2" @@ -43,7 +44,7 @@ func main() { wsSession := c.Query("auth") // no auth query available - if len(wsSession) == 0 { + if len(wsSession) != utils.LenWebSocketSession { return c.SendStatus(fiber.StatusUnauthorized) } diff --git a/modules/utils/definitions.go b/modules/utils/definitions.go new file mode 100644 index 0000000..b123795 --- /dev/null +++ b/modules/utils/definitions.go @@ -0,0 +1,5 @@ +package utils + +const ( + LenWebSocketSession = 36 +)