plugin-rewritebody icon indicating copy to clipboard operation
plugin-rewritebody copied to clipboard

Replace string with dynamic variable

Open Bukashk0zzz opened this issue 4 years ago • 0 comments

Hi,

I need to replace the host in the URL that in the body of the response to the current host like in this example from Nginx:

sub_filter '<img src="http://127.0.0.1:8080/' '<img src="https://$host/';

http://nginx.org/en/docs/http/ngx_http_sub_module.html

Any plan to add this feature? How I see from the code this feature can be implemented.

Syntax for example:

regex= "<img src="http://127.0.0.1:8080/"
replacement = "<img src="https://%s/"
replacementVariables = [req.Host]

Because of this I still need Nginx and http_sub_module

Bukashk0zzz avatar Sep 10 '20 05:09 Bukashk0zzz