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 46e2687 commit 7729272Copy full SHA for 7729272
share.go
@@ -107,9 +107,11 @@ func allowShare(r *http.Request) bool {
107
if r.Header.Get("X-AppEngine-Country") != "CN" {
108
return true
109
}
110
- for _, prefix := range temporaryAllowListIPPrefixes {
111
- if strings.HasPrefix(r.RemoteAddr, prefix) {
112
- return true
+ for _, forward := range strings.Split(r.Header.Get("X-Forwarded-For"), ",") {
+ for _, prefix := range temporaryAllowListIPPrefixes {
+ if strings.HasPrefix(strings.TrimSpace(forward), prefix) {
113
+ return true
114
+ }
115
116
117
return false
0 commit comments