-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
Move all rewrite handling logic into the rewrites module #353
Move all rewrite handling logic into the rewrites module #353
Conversation
Review changes with SemanticDiff. Analyzed 3 of 4 files. Overall, the semantic diff is 13% smaller than the GitHub diff.
|
JFYI @palant I will check the PR in the next hours but maybe you want to join us in Discord to also coordinate better reviews, tasks, time, etc. |
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.
Looks good to me. Just a minor doc to add as mentioned in the comment.
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.
Thanks!
Description
This implements the same changes to rewrites as have been implemented for redirects in #348. As suggested, I merged the identical code so that it is only present in the
redirects
module now.There are some changes to the handler: request fields can no longer be borrowed because we are now modifying the request. While I meant to implement these changes anyway, this unfortunately introduces a merge conflict with #351.
There are also some behavior changes due to the fact that destination is always being processed as a URL now and not merely in the redirect scenario:
alias
directive). Configuration example:This might be worth documenting. There are caveats however. First, it’s a good idea to rewrite to the same path and merely change the host name like I’ve done above, otherwise redirects when accessing directories will be a mess (this is generally an issue with rewrites). Second, someone who knows the name of the internal virtual host will still be able to access it by mapping this host name to the server’s IP address explicitly. So one should not expect anything under that host’s root to be hidden just because rewrites only map to some of the files there.
Related Issue
This is another step towards fixing #342, also fixes the rest of #347.
How Has This Been Tested?
Integration tests pass, some additional unit tests have been added as well. Functional testing on Linux looks fine.