Skip to content

Commit

Permalink
chore: update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
novln committed Nov 10, 2017
1 parent 0fdee94 commit a153298
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions examples/gin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func main() {

// Launch a simple server.
router := gin.Default()
router.ForwardedByClientIP = true
router.Use(middleware)
router.GET("/", index)
log.Fatal(router.Run(":7777"))
Expand Down
2 changes: 1 addition & 1 deletion examples/http/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func main() {
}

// Create a new middleware with the limiter instance.
middleware := stdlib.NewMiddleware(limiter.New(store, rate))
middleware := stdlib.NewMiddleware(limiter.New(store, rate), stdlib.WithForwardHeader(true))

// Launch a simple server.
http.Handle("/", middleware.Handler(http.HandlerFunc(index)))
Expand Down

0 comments on commit a153298

Please sign in to comment.