|
@@ -11,7 +11,10 @@ import (
|
|
|
"github.com/gin-gonic/gin"
|
|
|
)
|
|
|
|
|
|
-const CASDOOEN_HOST = "https://auth.3dqueen.cloud"
|
|
|
+const (
|
|
|
+ CASDOOEN_HOST = "https://auth.3dqueen.cloud"
|
|
|
+ ORIGIN = "https://www.infish.cn"
|
|
|
+)
|
|
|
|
|
|
// forwardRequestWithJWT forwards the request to target URL with JWT token and original request data
|
|
|
func forwardRequestWithJWT(c *gin.Context, targetURL string) (interface{}, error) {
|
|
@@ -43,8 +46,9 @@ func forwardRequestWithJWT(c *gin.Context, targetURL string) (interface{}, error
|
|
|
req.Header[k] = v
|
|
|
}
|
|
|
|
|
|
- // Set JWT token
|
|
|
+ // Set JWT token and Origin
|
|
|
req.Header.Set("Authorization", jwtToken)
|
|
|
+ req.Header.Set("Origin", ORIGIN)
|
|
|
|
|
|
// Set content type if it's a POST request
|
|
|
if c.Request.Method == "POST" {
|