Skip to content
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

Add action: Replace String in Response Value #59

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lukakoning
Copy link

With these changes I add the option to replace a string in the value of a response header.

One can select this action in the table of the config menu. Under the header field value you then provide a pattern like so: (text to search for)(text to replace with). For example (apple)(boat) will replace 'apple' with 'boat' in the value of the response header.

I was looking for this feature since I needed to change the Content-Security-Policy of a page. However, the Content-Security-Policy was dynamically crafted with nonces. I did not want to delete the entire CSP; I wanted a CSP with these nonces still in there. As a regular modify (always to one certain, pre-specified value) could not achieve this, I needed a string replace option.

Hereby I share that feature. If it gets accepted to the master branch, the README.md would still have to be updated to explain this feature.

Adds option to replace a string in the response header value
Adds option to replace a string in the response header value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant