{"id":6212893,"date":"2015-06-09T13:12:21","date_gmt":"2015-06-09T13:12:21","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/rewriting-protocol-issues\/"},"modified":"2016-08-30T14:15:28","modified_gmt":"2016-08-30T14:15:28","slug":"rewriting-protocol-issues","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/rewriting-protocol-issues\/","title":{"rendered":"Rewriting protocol issues"},"content":{"rendered":"<p>Hello,<\/p>\n<p>Your plugin changes the protocols of the entire page from http\/https to \/\/<br \/>\nWhile this is perfectly valid change for blogs that are running behind https, I find no value for this change to apply on blogs without SSL enabled.<\/p>\n<p>The change that you are making introduces issues when there is a resource loaded over HTTPS (eg https:\/\/some-resource.ltd) on a blog that is running without SSL (http).<br \/>\nYour plugin will rewrite the resource url from https:\/\/some-resource.ltd to \/\/some-resource.ltd and the browser will try to load the resource using the blog&#8217;s protocol which in this case is http. End result is that the resource will not be loaded.<\/p>\n<p>Even, if there is redirection on some-resource.ltd:80 to :443, it will fail for POST requests because browsers change the protocol from POST to GET when they receive status code 301. There is a newer status code introduced, 308, that is going to solve this problem but is not yet adopted by any of the modern browsers out there.<\/p>\n<p>I&#8217;d like to suggest that you do not overwrite the protocol when the page is loaded over http and only change the protocol when the page is loaded over https.<\/p>\n<p>Another temporary solution will be to NOT change the protocol if the protocol is already https.<\/p>\n<p>https:\/\/wordpress.org\/plugins\/cloudflare\/<\/p>\n","protected":false},"template":"","class_list":["post-6212893","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/6212893","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/6212893\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=6212893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}