code: func checkSameOrigin(r *http.Request) bool {
  	origin := r.Header["Origin"]
  	if len(origin) == 0 {
  		return true
  	}
  	u, err := url.Parse(origin[0])
  	if err != nil {
  		return false
  	}
  	return u.Host == r.Host
  }
docs: //###############//
  //### Private ###//
  //###############//
  // checkSameOrigin returns true if the origin is not set or is equal to the request host.
  // Source from gorilla websockets.