We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ty @jhliberty
The text was updated successfully, but these errors were encountered:
Almost forgot that we should not be using the * options for the Access-Control-Allow-Origin header. http://www.w3.org/TR/cors/#security
*
Access-Control-Allow-Origin
return func(w http.ResponseWriter, r *http.Request) { if origin := r.Header.Get("Origin"); origin != "" { w.Header().Set("Access-Control-Allow-Origin", origin) } }
Sorry, something went wrong.
To support OPTIONS we could create a simple lambda that returns a preflight response handler
Then do
router.HandleFunc("/current_action", GetCurrentAction).Methods("GET") router.HandleFunc("/current_action", NewPreFlightHandler("GET")).Methods("OPTIONS")
And then for more complicated endpoints
router.HandleFunc("/complicated", GetComplicated).Methods("GET") router.HandleFunc("/complicated", CreateComplicated).Methods("POST") router.HandleFunc("/complicated", NewPreFlightHandler("GET", "POST")).Methods("OPTIONS")
I think this works but it needs to be added to the other endpoints
austinpray
No branches or pull requests
ty @jhliberty
The text was updated successfully, but these errors were encountered: