Support for replacement based on a regular expression match.#1
Open
ptekchand wants to merge 2 commits intogarethhunt:masterfrom
Open
Support for replacement based on a regular expression match.#1ptekchand wants to merge 2 commits intogarethhunt:masterfrom
ptekchand wants to merge 2 commits intogarethhunt:masterfrom
Conversation
…in the value field.
Any string in the value for a Modify action which matches the form /foo/bar/ triggers the code.
foo can be a regular expression and bar is the string which replaces the match.
Example:
Action: Modify
Name: Host
Value: /^w{0,3}\.?domain.com$/192.168.254.65/
This will change www.domain.com and domain.com to 192.168.254.65 if found in the Host header.
Warning: This wouldn't work for matching '/' (such as in http://)
{RegEx}{replacement}
Changed from forward slash since users may want to match them in URLs such as in the Referer header.
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.
If the Header value for a Modify action is of the form
{RegEx}{replacement}
RegEx is a Regular expression
replacement is the string a matched header portion will be replaced with.
Perhaps some users may find this useful - to conditionally replace headers.
My master branch has changes which work replace the channel when the Host header is being modified, though I thought most users may not find that very useful.