Changeset 0.5.0 (#35)

This commit is contained in:
2026-02-19 15:03:20 +00:00
parent a93a6b9635
commit 30d0c11219
65 changed files with 5345 additions and 8070 deletions

View File

@@ -31,6 +31,13 @@ func Auth(cfg *config.Config) gin.HandlerFunc {
}
header := c.GetHeader("Authorization")
if header == "" {
// WebSocket connections can't set headers from browser.
// Fall back to ?token= query parameter.
if qToken := c.Query("token"); qToken != "" {
header = "Bearer " + qToken
}
}
if header == "" {
c.AbortWithStatusJSON(http.StatusUnauthorized, gin.H{
"error": "missing authorization header",