creativecommons / creativecommons.org

Legacy legal code translations and general support issues
MIT License
155 stars 201 forks source link

Cloudflare CDN issue in China: Assets from mirrors.creativecommons.org can not be loaded #1197

Closed Phuker closed 1 year ago

Phuker commented 3 years ago

Description

Button & icon images in mirrors.creativecommons.org can not be loaded, blocked by Cloudflare captcha. The settings in Cloudflare CDN might be inappropriate.

I'm not sure whether here is the right place to report this problem, if it's not then I'm sorry.

Reproduction

  1. Create a simple HTML file with these contents:
<img src="https://mirrors.creativecommons.org/presskit/icons/cc.svg" />
<img src="https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-nc-nd.svg" />
  1. Open a incognito private window in your browser to simulate a new visitor, and open this file.
  2. Boom, images can not be loaded. If a new visitor has not solved a captcha, the images can not be loaded.

Expectation

Images be loaded

Screenshots

error

Environment

Resolution

obulat commented 3 years ago

Thank you very much for reporting this issue, it's the right place for it. We will investigate.

kgodey commented 3 years ago

@Phuker we are unable to reproduce, what is the location you are trying to load these images from?

Phuker commented 3 years ago

@Phuker we are unable to reproduce, what is the location you are trying to load these images from?

If you mean geolocation, I'm in China, and I tested on all my cloud servers again, it seems the problem is narrowed down.

This time I ran this command:

curl -vv 'https://mirrors.creativecommons.org/presskit/icons/cc.svg'

There is no problem in Japan and the US, I can get a HTTP/2 200, image/svg+xml response.

But all requests from China got a HTTP/2 403, text/html captcha challenge response. It seems that Cloudflare blocks requests from China.

And FYI, I found this: Cloudflare community: Users in China Seeing Captcha

zackkrida commented 3 years ago

I am going to move this to a more general location, as it is relevant to any project using https://mirrors.creativecommons.org, not just this one. Thank you for sharing @Phuker

stevenjoezhang commented 3 years ago

Is it possible to publish an official package containing cc button & icon images to npm? In this way, users will be able to load images through CDN providers such as jsdelivr or unpkg

obulat commented 3 years ago

The assets are part of the Vocabulary package, and you can actually use them through jsdelivr /unpkg. Here you can find some more information: https://cc-vocabulary.netlify.app/?path=/docs/vocabulary-usage--page

stevenjoezhang commented 3 years ago

Thanks very much! I have confirmed that the badge can be loaded like this

<img src="https://cdn.jsdelivr.net/npm/@creativecommons/vocabulary@2020.11.3/assets/license_badges/big/by.svg">