Skip to content

Commit b47c56d

Browse files
author
Spencer Smolen
committed
updated cors error after changing domain to console.kriipke.io
1 parent b34a1a5 commit b47c56d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

deployments/manifests/api/configmap-app.yaml.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ data:
1111
POSTGRES_CA_CERT: "/app/configs/ca-postgres.crt"
1212
POSTGRES_PORT: "55555"
1313
PORT: "8080"
14-
CLIENT_ORIGIN: "http://0.0.0.0:3000"
14+
CLIENT_ORIGIN: "https://console.kriipke.io"
1515
EMAIL_FROM: "[email protected]"
1616
SMTP_HOST: "sandbox.smtp.mailtrap.io"
1717
SMTP_USER: "example_11f64b34eda5e4f"

pkg/middleware/cors.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ func CORSMiddleware() gin.HandlerFunc {
99
return func(c *gin.Context) {
1010
config, _ := initializers.LoadConfig("configs")
1111

12-
c.Writer.Header().Set("Access-Control-Allow-Origin", config.ClientOrigin)
12+
c.writer.header().set("access-control-allow-origin", fmt.printf("http://localhost:3000, https://localhost:3000, %s", config.ClientOrigin))
1313
c.Writer.Header().Set("Access-Control-Allow-Credentials", "true")
1414
c.Writer.Header().Set("Access-Control-Allow-Headers", "Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization, accept, origin, Cache-Control, X-Requested-With")
1515
c.Writer.Header().Set("Access-Control-Allow-Methods", "POST, OPTIONS, GET, PUT")

0 commit comments

Comments
 (0)