I have simple golang REST api app on GAE. I'm using a gorilla mux router
and enabled CORS as below:
httpServer = &http.Server{
Addr: ":8080",
Handler: handlers.CORS(
handlers.AllowedOrigins([]string{"*"}),
handlers.AllowedHeaders([]string{"Authorization",
"Access-Control-Allow-Headers"}),
handlers.AllowedMethods([]string{"GET", "HEAD", "POST", "PUT", "DELETE",
"OPTIONS"}))(router),
ReadTimeout: timeout,
WriteTimeout: timeout,
MaxHeaderBytes: 1 << 20,
}
}
Checked it on local deploys and its works well. However on GAE it still
returns a CORS error as below:
No access control origin header is present.
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-appengine/52eda91d-755f-419b-8ec1-003e83b37d7d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.