Skip to content

Commit 3a028e6

Browse files
author
Matija Petrunic
committed
Enable ws origin
1 parent e1e74dc commit 3a028e6

File tree

1 file changed

+5
-1
lines changed
  • internal/controllers

1 file changed

+5
-1
lines changed

internal/controllers/ws.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
package controllers
22

33
import (
4+
"net/http"
5+
46
"github.com/NodeFactoryIo/vedran/internal/configuration"
57
"github.com/NodeFactoryIo/vedran/internal/ws"
68
"github.com/gorilla/websocket"
79
log "github.com/sirupsen/logrus"
8-
"net/http"
910
)
1011

1112
var upgrader = websocket.Upgrader{
1213
ReadBufferSize: 1024,
1314
WriteBufferSize: 1024,
15+
CheckOrigin: func(r *http.Request) bool {
16+
return true
17+
},
1418
}
1519

1620
func (c ApiController) WSHandler(w http.ResponseWriter, r *http.Request) {

0 commit comments

Comments
 (0)