-
-
Notifications
You must be signed in to change notification settings - Fork 607
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
Get rid of TYPO3 trustedHostsPattern warning, fixes #1739 #1741
Conversation
This sets trustedHostsPattern to all configured hosts + "localhost" and "127.0.0.1".
Please standby. I discovered a problem with 127.0.0.1:.. |
Port numbers are appended to HTTP_HOST if they are non-standard. They could theoretically be extracted from app.GetAllURLs() but I am not sure if it would be enough to just strip `http://`/ `https://` from these values or if they might also be followed by a path. This takes a shortcut and does not whitelist the actual ports but rather allows ALL ports. I guess this is reasonable to keep the code simple.
…rIP() to get host's interface IP The output containing the backslashed looks like that: $GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] = 't3-master.ddev.site(:\\d+)?|localhost(:\\d+)?|127.0.0.1(:\\d+)?';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if there's a simpler and more readable regex. With just a single hostname we get $GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] = 't3v9.ddev.site(:\\d+)?|localhost(:\\d+)?|127.0.0.1(:\\d+)?';
, which is pretty mind-boggling.
Could we do something like (host1.ddev.site|host2.ddev.site|host3.ddev.site|127.0.0.1|<docker ip>):?[0-9]*
Yes, sure. That works, too :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good and worked perfectly for me. I added lots of hostnames, etc, and using @jonaseberle 's TYPO3 patch from https://review.typo3.org/c/Packages/TYPO3.CMS/+/61374 it resulted in a completely clean https install. Thanks! Amazing work.
This sets trustedHostsPattern to all configured hosts + "localhost" and "127.0.0.1".
Please excuse my zero Go skills and correct me where needed.
The Problem/Issue/Bug:
How this PR Solves The Problem:
Manual Testing Instructions:
Automated Testing Overview:
Related Issue Link(s):
Release/Deployment notes: