playground: loosen restrictions on IPs permitted to share We seem to be getting false-positives in core functionality. For instance, golang.org/share proxies the request to play.golang.org, and the X-AppEngine-Country header seen by play is 'ZZ' which is currently a restricted country. Since play.golang.org is blocked in places where we care to restrict its use, it sort of doesn’t really matter. So only block the one country that cares. Fixes golang/go#17765 Fixes golang/go#23038 Change-Id: If690a872d41d7db381e4623763a3d1b5b17a0d86 Reviewed-on: https://go-review.googlesource.com/86316 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/share.go b/share.go index 2c783e8..6dd5adc 100644 --- a/share.go +++ b/share.go
@@ -11,7 +11,6 @@ "fmt" "io" "net/http" - "os" ) const ( @@ -84,11 +83,7 @@ } func allowShare(r *http.Request) bool { - if os.Getenv("GAE_INSTANCE") == "" { - return true - } - switch r.Header.Get("X-AppEngine-Country") { - case "", "ZZ", "CN": + if r.Header.Get("X-AppEngine-Country") == "CN" { return false } return true