TUN-7421: Add *.cloudflare.com to permitted Origins for management WebSocket requests

This commit is contained in:
Devin Carr 2023-05-11 10:13:39 -07:00
parent 9426b60308
commit c43e07d6b7
1 changed files with 5 additions and 1 deletions

View File

@ -216,7 +216,11 @@ func (m *ManagementService) parseFilters(c *websocket.Conn, event *ClientEvent,
// Management Streaming Logs accept handler // Management Streaming Logs accept handler
func (m *ManagementService) logs(w http.ResponseWriter, r *http.Request) { func (m *ManagementService) logs(w http.ResponseWriter, r *http.Request) {
c, err := websocket.Accept(w, r, nil) c, err := websocket.Accept(w, r, &websocket.AcceptOptions{
OriginPatterns: []string{
"*.cloudflare.com",
},
})
if err != nil { if err != nil {
m.log.Debug().Msgf("management handshake: %s", err.Error()) m.log.Debug().Msgf("management handshake: %s", err.Error())
return return