mirror of
https://github.com/UNITRONIX/BetterDesk.git
synced 2026-09-10 17:45:42 +00:00
1b240543bd
- Added functionality for safely consolidating legacy auth.db into the selected SQLite database, with options for dry runs and rollbacks. - Introduced command-line flags for SQLite auth consolidation, including backup directory and rollback options. - Enhanced admin interface security by requiring a password when the admin port is enabled, preventing unauthorized access. - Updated related tests to ensure proper handling of admin password requirements and relay authorization logic.
15 lines
498 B
Go
15 lines
498 B
Go
package meshcentral
|
|
|
|
import "github.com/coder/websocket"
|
|
|
|
// webSocketAcceptOptions preserves the WebSocket library's same-host origin
|
|
// checks by default and permits explicitly configured browser origins. Clients
|
|
// without an Origin header, such as MeshAgent, remain protocol-compatible.
|
|
func (g *Gateway) webSocketAcceptOptions() *websocket.AcceptOptions {
|
|
opts := &websocket.AcceptOptions{}
|
|
if g != nil && g.cfg != nil {
|
|
opts.OriginPatterns = g.cfg.GetAllowedWSOrigins()
|
|
}
|
|
return opts
|
|
}
|