Resolving early termination due to protocol URL in widget_script.phtml #132
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The protocol-relative URL was causing this script to terminate early on "compilation." The result in the static deployed files (causing an HTTP Error 500) appeared as:
This behavior was observed consistently across development, staging, and production environments.
As of December 2014, Paul Irish's blog on protocol-relative URLs says "2014.12.17: Now that SSL is encouraged for everyone and doesn’t have performance concerns, this technique is now an anti-pattern. If the asset you need is available on SSL, then always use the https:// asset."
My observation is that static resources served through Yotpo are already secure and thus should be enforced using https instead of protocol-relative urls. Changing the url specificity to https resolved the issue and is, in any regard, more secure.