Skip to content

Commit

Permalink
Moce header
Browse files Browse the repository at this point in the history
  • Loading branch information
abaldeweg authored Oct 19, 2024
1 parent 946bd77 commit a6d9173
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gateway/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@ func Routes() *gin.Engine {

r := gin.Default()

r.Use(func(c *gin.Context) {
c.Header("Access-Control-Allow-Origin", c.Request.Header.Get("Origin"))
c.Next()
})

r.Any(`/apis/core/1/*path`, handleCoreAPI)

return r
}

func handleCoreAPI(c *gin.Context) {
c.Header("Access-Control-Allow-Origin", c.Request.Header.Get("Origin"))

path := c.Param("path")

uploadCover(c, path)
Expand Down

0 comments on commit a6d9173

Please sign in to comment.