-
Notifications
You must be signed in to change notification settings - Fork 9
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
Bug: Filter doesn't work on complicated HTTP responses? #1
Comments
So I'm not certain cause you didn't really give enough info to know for sure (logs, what system, how you ran Caddy, etc) but I think it probably has to do with the directive ordering stuff I just wrote about in this issue: #2 I'm guessing you tried to |
Hi, Thanks so much for the kind reply. In regards to your questions, indeed I was fully restarting Caddy each time so my changes were being reflected accordingly. In regards to directive ordering, I tried a bunch of them at the time. I tried ordering before I was poking around the unit tests hoping to gleam if I was missing anything, but it doesn't seem like it. If I setup something simple like the unit test does, it works just fine. However, whenever I try to hit a proper website to do a replace on some web element, It doesn't work. |
I haven't actually tried this plugin yet, I'm just coming at this from a relatively deep understanding of the Caddy internals after having written plenty of PRs for the project in the last few months. You might be right that the plugin is just broken, but we'll need to wait until @htfy96 clarifies for us 😄 |
Ah, ok. Thanks for the heads up! I was worried that maybe this plugin only works against requests being served locally and not via proxy. It would be a shame if so, as this seems like a pretty powerful feature. |
Yes. @francislavoie is correct. The problem here is the order of plugins. The recommended way as per @francislavoie is to add this to your Caddyfile:
The following Caddyfile works:
|
I have updated the doc to include the Closing this issue now. Feel free to reopen it if you have any question! |
Thanks for the kind reply. I am able to reproduce what your seeing, in that if I However, if I direct my web browser to the same URL, it appears that all my changes are gone. Would you happen to know why |
I can reproduce this issue locally. The root cause still seems to be directive orders. This plugin doesn't work when |
Thanks for looking into this. I think this is why initially I thought the plugin wasn't working. Because I never bothered to check I look forward to hearing about what you found! |
After some efforts I believe this is a consequence of the design of Caddy's reverse_proxy module. In short, when we request a compressed response with Technical details: reverse proxy internally uses HTTPTransport in Go. However, it would only transparently decompress the response when the client (Caddy) doesn't add I think it would be best for Caddy to add an option like |
I think you can just set something like Another possible enhancement, this module could look at the |
|
I would agree with what has been said. It would be better to find a proper solution to for this edge-case rather than adding specific workarounds to this module. That way, everyone benifits from getting the change and workerounds don't need to duplicated in projects that need it. |
Hi,
So I was testing this plugin out with a simple Caddyfile example:
In this, I expected all instances of "Lorem Ipsum" on the page to be turned into "New Name". However, nothing seems to happen. Is this a bug, or is there some usage of this plugin that is incorrect?
The text was updated successfully, but these errors were encountered: