func (gm *GMServer) createOptionsHandler(methods ...string) func(w http.ResponseWriter, r *http.Request) {
	return func(w http.ResponseWriter, r *http.Request) {
		w.Header().Set("Access-Control-Allow-Methods", strings.Join(methods, ", "))
		w.Header().Set("Access-Control-Allow-Headers", "Authorization, Content-Type")
		// TODO: change 1 to something like 86400
		w.Header().Set("Access-Control-Max-Age", "1")
	}
}
// createOptionsHandler creates an endpoint handler for the OPTIONS method: the
// handler will set a few headers: Access-Control-Allow-Headers,
// Access-Control-Max-Age, and Access-Control-Allow-Methods with the provided
// methods.
createOptionsHandler creates an endpoint handler for the OPTIONS method: the
handler will set a few headers: Access-Control-Allow-Headers,
Access-Control-Max-Age, and Access-Control-Allow-Methods with the provided
methods.
// createOptionsHandler creates an endpoint handler for the OPTIONS method : the // handler will set a few headers : Access - Control - Allow - Headers // Access - Control - Max - Age and Access - Control - Allow - Methods with the provided // methods .
func (gm *GMServer) createOptionsHandler(methods ...string) func(w http.ResponseWriter, r *http.Request) {
	return func(w http.ResponseWriter, r *http.Request) {
		w.Header().Set("Access-Control-Allow-Methods", strings.Join(methods, ", "))
		w.Header().Set("Access-Control-Allow-Headers", "Authorization, Content-Type")
		w.Header().Set("Access-Control-Max-Age", "1")
	}
}
func ( gm * GMServer ) createOptionsHandler ( methods ... string ) func ( w http . ResponseWriter , r * http . Request ) { return func ( w http . ResponseWriter , r * http . Request ) { w . Header ( ) . Set ( " " , strings . Join ( methods , " " ) ) w . Header ( ) . Set ( " " , " " ) w . Header ( ) . Set ( " " , " " ) } }
createOptionsHandler creates an endpoint handler for the OPTIONS method: the
handler will set a few headers: Access-Control-Allow-Headers,
Access-Control-Max-Age, and Access-Control-Allow-Methods with the provided
methods.
createOptionsHandler creates an endpoint handler for the OPTIONS method : the handler will set a few headers : Access - Control - Allow - Headers Access - Control - Max - Age and Access - Control - Allow - Methods with the provided methods .
// TODO: change 1 to something like 86400