replace-response icon indicating copy to clipboard operation
replace-response copied to clipboard

Environment Variables - Incorrect Replacements

Open ManOki opened this issue 2 years ago • 1 comments

Hi,

I use caddy 2.6.2 with replace-response and noticed some weird replacements. I want to add a webroot/subdirectory to absolute paths which are stored in environment variables DOMAIN=mydomain.com and WEBROOT=/app.

replace https://{$DOMAIN} https://{$DOMAIN}{$WEBROOT} updated response from https://mydomain.com/script.js to https:///appmydomain.com/script.js (incorrect order within environment variable values).

After that I tried replace https://{$DOMAIN} https://before{$DOMAIN}after which results in https://beforeaftermydomain.com/script.js (environment variable values are always suffixed).

I expected https://mydomain.com/app/script.js. The hardcoded workaround replace https://mydomain.com https://mydomain.com/app works as expected.

Greets, ManOki

ManOki avatar Dec 31 '22 13:12 ManOki

That's odd. What is the output of caddy adapt on your config?

mholt avatar Dec 31 '22 16:12 mholt