From 69e28265d9a41e9d365315a7380648cea8ea6862 Mon Sep 17 00:00:00 2001 From: Michael Stillwell Date: Tue, 8 Oct 2019 15:25:15 +0100 Subject: [PATCH 1/2] Cloudflare's AMP Cache is no longer supported --- build-system/global-configs/caches.json | 8 -------- build-system/tasks/json-check.js | 2 +- spec/amp-cache-guidelines.md | 1 - spec/amp-cors-requests.md | 5 ----- validator/engine/validator-in-browser.js | 4 ++-- 5 files changed, 3 insertions(+), 17 deletions(-) diff --git a/build-system/global-configs/caches.json b/build-system/global-configs/caches.json index 0c3edcd3c3e2..16837265c242 100644 --- a/build-system/global-configs/caches.json +++ b/build-system/global-configs/caches.json @@ -8,14 +8,6 @@ "updateCacheApiDomainSuffix": "cdn.ampproject.org", "thirdPartyFrameDomainSuffix": "ampproject.net" }, - { - "id": "cloudflare", - "name": "Cloudflare AMP Cache", - "docs": "https://amp.cloudflare.com/", - "cacheDomain": "amp.cloudflare.com", - "updateCacheApiDomainSuffix": "amp.cloudflare.com", - "thirdPartyFrameDomainSuffix": "cloudflareamp.net" - }, { "id": "bing", "name": "Bing AMP Cache", diff --git a/build-system/tasks/json-check.js b/build-system/tasks/json-check.js index f25e576fd753..c88b635c3987 100644 --- a/build-system/tasks/json-check.js +++ b/build-system/tasks/json-check.js @@ -21,7 +21,7 @@ const log = require('fancy-log'); const through2 = require('through2'); const {jsonGlobs} = require('../test-configs/config'); -const expectedCaches = ['cloudflare', 'google']; +const expectedCaches = ['google']; const cachesJsonPath = 'build-system/global-configs/caches.json'; diff --git a/spec/amp-cache-guidelines.md b/spec/amp-cache-guidelines.md index 73c65730c3d9..015acfc831d1 100644 --- a/spec/amp-cache-guidelines.md +++ b/spec/amp-cache-guidelines.md @@ -105,7 +105,6 @@ For resources (i.e., HTML, images, fonts) that are larger than 12 MB, you may no ## References -* [Cloudflare AMP Cache](https://amp.cloudflare.com/) * [Google AMP Cache](https://developers.google.com/amp/cache/) * [Google AMP Cache Overview](https://developers.google.com/amp/cache/overview) * The [Google AMP Cache](https://developers.google.com/amp/cache/) is a proxy-based content delivery network for delivering all valid AMP documents. diff --git a/spec/amp-cors-requests.md b/spec/amp-cors-requests.md index 54deb3fb145c..411cfc9c8472 100644 --- a/spec/amp-cors-requests.md +++ b/spec/amp-cors-requests.md @@ -141,12 +141,10 @@ Endpoints should only allow requests from: (1) the publisher's own origin; and For example, endpoints should allow requests from: * Google AMP Cache subdomain: `https://.cdn.ampproject.org`
(for example, `https://nytimes-com.cdn.ampproject.org`) - * Cloudflare AMP Cache: `https://.amp.cloudflare.com` {% call callout('Read on', type='read') %} For information on AMP Cache URL formats, see these resources: - [Google AMP Cache Overview](https://developers.google.com/amp/cache/overview) -- [Cloudflare AMP Cache](https://amp.cloudflare.com/) {% endcall %} @@ -193,7 +191,6 @@ following: 1. If the origin does not match one of the following values, stop and return an error response: - `.cdn.ampproject.org` - - `.amp.cloudflare.com` - the publisher's origin (aka yours) where `*` represents a wildcard match, and not an actual asterisk ( * ). @@ -227,7 +224,6 @@ Based on what we know about CORS and AMP (from [Verify CORS requests](#verify-co * `example.com` --- Publisher's domain * `example-com.cdn.ampproject.org` --- Google AMP Cache subdomain -* `example.com.amp.cloudflare.com`--- Cloudflare AMP Cache subdomain ### Response headers for allowed requests @@ -273,7 +269,6 @@ function assertCors(req, res, opt_validMethods, opt_exposeHeaders) { const allowedOrigins = [ "https://example.com", "https://example-com.cdn.ampproject.org", - "https://example.com.amp.cloudflare.com", "https://cdn.ampproject.org" ]; let origin; diff --git a/validator/engine/validator-in-browser.js b/validator/engine/validator-in-browser.js index 8067b9e7d7ad..cbac0003a0bd 100644 --- a/validator/engine/validator-in-browser.js +++ b/validator/engine/validator-in-browser.js @@ -52,8 +52,8 @@ function getUrl(url) { */ amp.validator.isAmpCacheUrl = function(url) { return ( - url.toLowerCase().indexOf('cdn.ampproject.org') !== -1 || // lgtm [js/incomplete-url-substring-sanitization] - url.toLowerCase().indexOf('amp.cloudflare.com') !== -1); // lgtm [js/incomplete-url-substring-sanitization] + url.toLowerCase().indexOf('cdn.ampproject.org') !== -1 // lgtm [js/incomplete-url-substring-sanitization] + ); }; /** From 6d91de457685a5f218303d536ddc07e444aaf2d8 Mon Sep 17 00:00:00 2001 From: Michael Stillwell Date: Tue, 8 Oct 2019 16:54:47 +0100 Subject: [PATCH 2/2] Remove cloudflare.com form test --- validator/testdata/feature_tests/forms.html | 4 ---- 1 file changed, 4 deletions(-) diff --git a/validator/testdata/feature_tests/forms.html b/validator/testdata/feature_tests/forms.html index c38ae00e52a5..7fa2baaa93ae 100644 --- a/validator/testdata/feature_tests/forms.html +++ b/validator/testdata/feature_tests/forms.html @@ -112,10 +112,6 @@
- -
- -