Skip to content

Commit

Permalink
implement CheckOrigin on server-side
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmohar committed Aug 20, 2021
1 parent f84d108 commit df158c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/internal/ws/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ var (
WriteBufferSize: 1024,
// TODO: For now we don't really check origin
CheckOrigin: func(r *http.Request) bool {
return true
origin := r.Header.Get("Origin")
return origin == "https://ptrun.develop.cloud.ptr.si"
},
}
)
Expand Down

0 comments on commit df158c1

Please sign in to comment.