We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a5dbf8a commit 079e92bCopy full SHA for 079e92b
src/webserver.go
@@ -63,8 +63,14 @@ func runWebServer() {
63
c.JSON(http.StatusNotFound, gin.H{"code": "PAGE_NOT_FOUND", "message": "Page not found"})
64
})
65
66
- // disable proxy feature of gin
67
- _ = router.SetTrustedProxies(nil)
+ // Set proxy feature of gin
+ trustedProxies := getEnv("GIN_TRUSTED_PROXIES", "")
68
+ if len(trustedProxies) > 0 {
69
+ _ = router.SetTrustedProxies(strings.Split(trustedProxies, ","))
70
+ log.Print(strings.Split(trustedProxies, ","))
71
+ } else {
72
+ _ = router.SetTrustedProxies(nil)
73
+ }
74
75
// Ping-endpoint
76
router.GET("/ping", func(c *gin.Context) {
0 commit comments