add cors allow methods and headers
This commit is contained in:
parent
1bd42249ce
commit
2749da6df9
@ -11,7 +11,8 @@ func Cors(handler http.Handler) http.Handler {
|
|||||||
switch origin {
|
switch origin {
|
||||||
case "http://localhost:5173", "http://localhost", "https://alai.cromer.cl":
|
case "http://localhost:5173", "http://localhost", "https://alai.cromer.cl":
|
||||||
writer.Header().Set("Access-Control-Allow-Origin", origin)
|
writer.Header().Set("Access-Control-Allow-Origin", origin)
|
||||||
writer.Header().Set("Access-Control-Allow-Headers", "Content-Type")
|
writer.Header().Set("Access-Control-Allow-Methods", "GET,HEAD,OPTIONS,POST,PUT,DELETE,PATCH")
|
||||||
|
writer.Header().Set("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization")
|
||||||
}
|
}
|
||||||
|
|
||||||
handler.ServeHTTP(writer, request)
|
handler.ServeHTTP(writer, request)
|
||||||
|
Loading…
Reference in New Issue
Block a user