list all wallets for current user (WA-9)

This commit is contained in:
Fran Jurmanović
2021-05-29 21:50:48 +02:00
parent 9531cc14fb
commit 035ed4b486
7 changed files with 63 additions and 6 deletions

19
pkg/middleware/cors.go Normal file
View File

@@ -0,0 +1,19 @@
package middleware
import "github.com/gin-gonic/gin"
func CORSMiddleware() gin.HandlerFunc {
return func(c *gin.Context) {
c.Writer.Header().Set("Access-Control-Allow-Origin", "*")
c.Writer.Header().Set("Access-Control-Allow-Credentials", "true")
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")
c.Writer.Header().Set("Access-Control-Allow-Methods", "POST, OPTIONS, GET, PUT")
if c.Request.Method == "OPTIONS" {
c.AbortWithStatus(204)
return
}
c.Next()
}
}