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

apache: rewriting the missing trailing slash when in an iframe breaks the page #134

Closed
apolopena opened this issue May 10, 2021 · 3 comments
Assignees
Labels
bug Something isn't working passed-dev-qa Optional state. Use this when QAing other peoples fixes in another branch.ready to be merged to main

Comments

@apolopena
Copy link
Owner

Describe the bug

When using SimpleBrowser or any iframe and using a gitpod/project url (ending in a directory name) without a trailing slash, the rewrite is triggered to rewrite the url with a trailing slash but $scheme is used so the rewrite uses http when the parent of the iframe is https. This triggers a mixed content error and the page does not load.

This issue of course does not occur when using an external browser

Screenshots

Steps to reproduce

with a default starter run the url in the simple browser with /phpmayadmin rather than /phpmyadmin/
inspect the page

You will see the mixed content errors and a white screen.

Expected behavior

trailing slash rewrites should not break the page when displayed in an iframe.

Additional information

To fix this we will use brute force by rewriting trailing slashes to use https instead of $scheme.
Since gitpod uses https this hardcoded fix will not break anything.

@apolopena apolopena added the bug Something isn't working label May 10, 2021
@apolopena apolopena self-assigned this May 10, 2021
@apolopena
Copy link
Owner Author

workaround this for now by always appending urls ending in a directory with a trailing slash.
You can also do this with op by doing something like this: op phpmyadmin/

@apolopena
Copy link
Owner Author

fixed by overwriting default apache2.conf to replace:
ServerName ${APACHE_SERVER_NAME}
with
ServerName https://localhost
This seems to force redirected trailing slash requests to use https rather than http

@apolopena
Copy link
Owner Author

depends on #135

apolopena added a commit that referenced this issue May 10, 2021
@apolopena apolopena added in-dev-qa passed-dev-qa Optional state. Use this when QAing other peoples fixes in another branch.ready to be merged to main and removed in-dev-qa labels May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working passed-dev-qa Optional state. Use this when QAing other peoples fixes in another branch.ready to be merged to main
Projects
None yet
Development

No branches or pull requests

1 participant