Rewriting protocol issues
-
Hello,
Your plugin changes the protocols of the entire page from http/https to //
While 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.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).
Your 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’s protocol which in this case is http. End result is that the resource will not be loaded.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.
I’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.
Another temporary solution will be to NOT change the protocol if the protocol is already https.
- The topic ‘Rewriting protocol issues’ is closed to new replies.