Repository navigation
Conversation
proxy.sh puts nginx in front of the throwaway site and checks the "behind a proxy it has not been told about" notice four ways: direct; through a proxy the host resolves (REMOTE_ADDR is the visitor, X-Forwarded-For still passed, as on WordPress.com); through an unresolved proxy, where the notice must show and its button must open the trusted-proxies field; and with the proxy trusted. The official wordpress image ships mod_remoteip on, trusting private ranges, so the harness is a resolving host out of the box; the unresolved case turns the module and its conf off (validated before reload, since a broken config makes graceful silently keep the old one) and the EXIT trap restores them. 2.10.4 fails it on the false notice and the button's 403; 2.10.5 passes. smoke.sh still passes with the proxy service in the compose file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds
tests/wp-compat/proxy.sh, which puts an nginx reverse proxy in front of the throwaway WordPress site and checks the "behind a proxy it has not been told about" notice. It's the regression test for the bugs fixed in 2.10.5 (#113).What it checks
REMOTE_ADDRis the visitor andX-Forwarded-Foris still passed, as on WordPress.comREMOTE_ADDRis the proxyNote on the harness
The official
wordpressimage shipsmod_remoteipturned on, trusting private address ranges. So the harness already behaves like a host that resolves the visitor. For the unresolved case the script turns the module and its config off, and an exit handler turns them back on.The config is validated before each reload. Disabling only the module leaves an invalid config, and Apache's graceful reload then silently keeps the old config running.
Results
page=webdecoy-settings, the two bugs reported.PROXY OK.smoke.shstill ends withSMOKE OKwith the new proxy service in the compose file.