Edit proxied response.Body

(Ollie Phillips) #1

Hi all. I’d like to be able edit the response body of a proxied request. The aim, would be to replace all links/requests for insecure assets in a page with either “https://address” or “//address” (I think the latter is sufficient to prevent insecure content warnings in browsers?) This would allow Caddy to front websites and provide TLS without having to revisit the code of each those (older) sites to make the above amends. I can see it’s possible to amend headers up and down stream, is something similar possible for the response body? I am unable to find it in the docs so I suspect not.

(Matt Holt) #2

Does the http.filter plugin do what you need? https://caddyserver.com/docs/http.filter

(Ollie Phillips) #3

I’m sorry - I hadn’t seen that. I was looking at the standard http directives. It looks like it would be perfect. Sorry again :blush:

Edit: It is perfect. A fantastic plugin.

1 Like
(Matt Holt) #5

It’s fine. Glad it does the trick! There are a lot of third party contributed plugins that do some cool stuff.

1 Like
(system) closed #6

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.