iris
iris copied to clipboard
Access-Control-Allow-Origin
How can i configure the hearders?
func(ctx context.Context){
/*
ctx.ResponseWriter() // gives you the http.ResponseWriter
ctx.Request() // gives you the *http.Request
to set a header you use the response writer or the ctx.Header("key", "value")
to get a request header you use the request or the ctx.GetHeader("key")
*/
ctx.Header("Access-Control-Allow-Origin", "*")
}
Examples could be found here.
Thank you