Provide custom options of TrustedPlatform for another CDN services (#2906)

* refine TrustedPlatform and docs

* refactor for switch

* refactor switch to if statement
This commit is contained in:
Notealot
2021-10-24 08:34:03 +08:00
committed by GitHub
parent 3fe928994b
commit 2d3d6d2f13
4 changed files with 49 additions and 12 deletions
+2 -2
View File
@@ -59,10 +59,10 @@ type RoutesInfo []RouteInfo
const (
// When running on Google App Engine. Trust X-Appengine-Remote-Addr
// for determining the client's IP
PlatformGoogleAppEngine = "google-app-engine"
PlatformGoogleAppEngine = "X-Appengine-Remote-Addr"
// When using Cloudflare's CDN. Trust CF-Connecting-IP for determining
// the client's IP
PlatformCloudflare = "cloudflare"
PlatformCloudflare = "CF-Connecting-IP"
)
// Engine is the framework's instance, it contains the muxer, middleware and configuration settings.