Skip to content

Commit

Permalink
feat: allow websocket connections from all origins
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Gleich <[email protected]>
  • Loading branch information
gleich committed Dec 22, 2024
1 parent 0e14837 commit c8c3dd1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ func NewCache[T any](name string, data T) *Cache[T] {
}),
filePath: filepath.Join(secrets.SECRETS.CacheFolder, fmt.Sprintf("%s.json", name)),
wsConnPool: make(map[*websocket.Conn]bool),
wsUpgrader: websocket.Upgrader{},
wsUpgrader: websocket.Upgrader{
CheckOrigin: func(r *http.Request) bool {
return true
},
},
}
cache.loadFromFile()
cache.Update(data)
Expand Down

0 comments on commit c8c3dd1

Please sign in to comment.