Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(iframe-block): add a trailing slash to iframe URL #906

Merged
merged 1 commit into from
Nov 16, 2021

Conversation

kariae
Copy link
Contributor

@kariae kariae commented Nov 10, 2021

All Submissions:

Changes proposed in this Pull Request:

Without the trailing slash, the iframe URL does a redirection to add the slash and set the request on HTTP which raises a mixed content issue, adding the trailing slash would stop the redirection and minimize the calls to the server. The issue was raised in the Atomic environment but I was able to reproduce it locally too.

How to test the changes in this Pull Request:

  1. If you don't have HTTPS use a temporary Atomic site.
  2. On a new post, add the iframe block.
  3. Upload a zip archive with at least an index.html file that will be the entry point to your iframe (I attached a zip archive for tests).
  4. Notice that the iframe doesn't preview, and the console shows a mixed content error due to a redirection to HTTP.
  5. Pull this PR.
  6. Upload again the same archive and notice this time there is no redirection and the iframe loads as expected.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

without the trailing slash, the iframe URL do a redirection to add the slash and set the request on
http which raise a mixed content issue, adding the trailing slash would stop the redirection and
minimize the calls to the server
Copy link
Contributor

@dkoo dkoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as described 👍

@kariae kariae merged commit e4b7b7d into master Nov 16, 2021
@kariae kariae deleted the fix/iframe-url-when-uploaded branch November 16, 2021 15:07
matticbot pushed a commit that referenced this pull request Nov 16, 2021
## [1.42.1-alpha.1](v1.42.0...v1.42.1-alpha.1) (2021-11-16)

### Bug Fixes

* **iframe-block:** add a trailing slash to iframe URL ([#906](#906)) ([e4b7b7d](e4b7b7d))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.42.1-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Nov 18, 2021
## [1.42.1](v1.42.0...v1.42.1) (2021-11-18)

### Bug Fixes

* **iframe-block:** add a trailing slash to iframe URL ([#906](#906)) ([e4b7b7d](e4b7b7d))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.42.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants