########################################################################################## FKAMP-6: Parse AMP CDN Urls to decide whether to redirect to HTTP or HTTPS ########################################################################################## Issue Type: Improvement ----------------------------------------------------------------------------------------- Issue Information ==================== Priority: Major Status: Closed Resolution: Done (2019-06-12 15:30:08) Project: Anti-AMP Scripts (FKAMP) Reported By: btasker Assigned To: btasker Targeted for fix in version: - v1.4.3 Time Estimate: 0 minutes Time Logged: 0 minutes ----------------------------------------------------------------------------------------- Issue Description ================== FKAMP-5 implemented detection of iframe elements referencing cdn.ampproject.org. Currently the logic, if one's detected is - Strip the URL fragment - Split on / - Take element 5 as the domain name - Take element 6 onwards as the path - prepend https:// - Redirect to that value In an ideal world, all origin sites would be HTTPS, but realistically that's not necessarily true. So, we really should make sure we trigger a redirect to the correct protocol. Looking at Google's AMP cache documentation, it looks like we can tell from the URL though. If position 4 == s then the origin is HTTPS, if not it's HTTP -- BEGIN QUOTE -- Because /s follows the /c prefix, the document will be fetched from example.com using TLS. -- END QUOTE -- So, we should include a check and set the protocol accordingly ----------------------------------------------------------------------------------------- Issue Relations ================ - relates to FKAMP-5: See if we can find a way to handle AMP on Google News - Google AMP Cache documentation (https://developers.google.com/amp/cache/overview) ----------------------------------------------------------------------------------------- Activity ========== ----------------------------------------------------------------------------------------- 2019-06-12 12:34:46 git ----------------------------------------------------------------------------------------- -- BEGIN QUOTE -- Repo: RemoveAMP Commit: 0b33a16700e64684313b6c120ad95b95be6359f2 Author: Ben Tasker