fix
This commit is contained in:
parent
f6e70d0386
commit
7cd48778e5
|
@ -117,7 +117,7 @@ type wsConnectItem struct {
|
||||||
// 请求建立连接,升级websocket协议
|
// 请求建立连接,升级websocket协议
|
||||||
func (l *DataTransferLogic) DataTransfer(w http.ResponseWriter, r *http.Request) {
|
func (l *DataTransferLogic) DataTransfer(w http.ResponseWriter, r *http.Request) {
|
||||||
origin := r.Header.Get("Origin")
|
origin := r.Header.Get("Origin")
|
||||||
//判断是不是允许的host
|
//判断是不是允许的跨域
|
||||||
upgrader.CheckOrigin = func(r *http.Request) bool {
|
upgrader.CheckOrigin = func(r *http.Request) bool {
|
||||||
if _, ok := mapAllowOrigin[origin]; !ok {
|
if _, ok := mapAllowOrigin[origin]; !ok {
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in New Issue
Block a user