#109 move last url to new layout
Some checks failed
Build Docker Image / Explore-Gitea-Actions (push) Failing after 7s
Some checks failed
Build Docker Image / Explore-Gitea-Actions (push) Failing after 7s
This commit is contained in:
@@ -7,14 +7,14 @@ import (
|
||||
)
|
||||
|
||||
func EnableCors(next http.Handler) http.Handler {
|
||||
var frontent_url = os.Getenv("FRONTEND_URL")
|
||||
if frontent_url == "" {
|
||||
log.Fatal("FRONTEND_URL is not set")
|
||||
var base_url = os.Getenv("BASE_URL")
|
||||
if base_url == "" {
|
||||
log.Fatal("BASE_URL is not set")
|
||||
}
|
||||
log.Println("FRONTEND_URL is", frontent_url)
|
||||
log.Println("BASE_URL is", base_url)
|
||||
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Access-Control-Allow-Origin", frontent_url)
|
||||
w.Header().Set("Access-Control-Allow-Origin", base_url)
|
||||
w.Header().Set("Access-Control-Allow-Methods", "GET, POST, DELETE")
|
||||
w.Header().Set("Access-Control-Allow-Headers", "Authorization")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user