Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/playground: revise GeoIP blocking rules for China #45525

csalinezh opened this issue Apr 12, 2021 · 1 comment

x/playground: revise GeoIP blocking rules for China #45525

csalinezh opened this issue Apr 12, 2021 · 1 comment


Copy link

@csalinezh csalinezh commented Apr 12, 2021

Currently will check the origin of requests by header X-Appengine-Country (related code), which is set by GAE frontend, and is probably powered by GeoIP data used across Google. If X-Appengine-Country matches the code of China, the request will be denied and HTTP 451 Unavailable For Legal Reasons would be returned.

Such restriction was first introduced in golang/playground@64f7014, citing the reason that "[t]his will permit us to serve * to Chinese users." The related code was later revised in golang/playground@bb2a4ed, citing similar need.

The reason was elaborated in #31755 (comment) in May 2019 by @bradfitz:

A requirement for Google getting Chinese approval for was that we didn't serve any user-generated content (UGC). That's why the playground is disabled on the Chinese domain, as's "Share" functionality lets people share user-generated content (code).

However, the current restriction does not reflect the fact that * has already been blocked by the Great Firewall for years, which was acknowledged in the aforementioned issue and golang/playground@bb2a4ed. That's why a separate has to be set up for users in Mainland China. The original cause for this restriction no longer exists. Playground is simply not provided in

Meanwhile, the GeoIP false-positives has caused inconvenience to multiple users, including a recent one #45378, and might pop up every time Google updates its GeoIP db.

I propose the restriction targeing CN users to be lifted, since GFW has already done its job to block unregulated user-generated content.

@gopherbot gopherbot added this to the Unreleased milestone Apr 12, 2021
Copy link

@mknyszek mknyszek commented Apr 12, 2021

CC @toothrot who is listed as an owner of the playground.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants