-
Notifications
You must be signed in to change notification settings - Fork 0
/
cors.go
34 lines (29 loc) · 924 Bytes
/
cors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package config
import (
"os"
"strings"
"github.com/gofiber/fiber/v2/middleware/cors"
)
var origins = []string{
"https://auth.ulbi.ac.id",
"https://sip.ulbi.ac.id",
"https://euis.ulbi.ac.id",
"https://home.ulbi.ac.id",
"https://alpha.ulbi.ac.id",
"https://dias.ulbi.ac.id",
"https://iteung.ulbi.ac.id",
"https://whatsauth.github.io",
"http://127.0.0.1:5500",
"http://127.0.0.1:5501",
"http://127.0.0.1:8080",
"https://indrariksa.github.io",
"https://kindiherdiansyah.github.io",
}
var Internalhost string = os.Getenv("INTERNALHOST") + ":" + os.Getenv("PORT")
var Cors = cors.Config{
AllowOrigins: strings.Join(origins[:], ","),
AllowMethods: "GET,HEAD,OPTIONS,POST,PUT,DELETE",
AllowHeaders: "Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Request-Headers, Token, Access-Control-Allow-Origin",
ExposeHeaders: "Content-Length",
AllowCredentials: true,
}