Added header for the redirect from Post ID #218
Merged
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.
Description of the Change
This PR adds the redirect post ID to the HTTP response headers. Its' purpose is to aid debugging where a redirect is coming from.
Where there are a large number of similar redirects e.g. for "reviews" it can be hard to pinpoint exactly where the active redirect is coming from.
Alternate Designs
N/A
Benefits
The addition of the Post ID will help developers see which redirect rule took effect.
Possible Drawbacks
The ID of the redirect post will be available to anyone looking at the headers. I don't believe this is a security concern since external users won't be able to achieve anything with this.
Verification Process
I set up a local install with SRM as the only active plugin; I setup a redirect, cleared the transient cache and loaded the URL that would trigger the redirect rule.
I confirmed that the post ID (
5
in this case) shows in the response headers.Checklist:
Applicable Issues
N / A - this doesn't directly relate to an issue here, I just needed to debug where a redirect was coming from.
Changelog Entry
Added redirect Post ID to response headers where a redirect rule is invoked.