-
Notifications
You must be signed in to change notification settings - Fork 209
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
Hoverfly Spy mode and nginx proxy_pass do not work together #944
Comments
It's a very weird edge case. It doesn't work in ✅ spy mode with header matcher; the request is matched: Got 200 with simulated response When it fails, I got something like this:
Is it similar to what you get as well @ttiurani ? I'm not sure what the cause is yet, but will try to debug |
Yes, exactly the issue. Furthermore, if the request doesn't have a body at all, the passthrough seems to also work even with headers matchers. It's unfortunate nginx doesn't tell what exactly is wrong with it, but I'm thinking, because it needs the body, |
Noticed a very likely related bug in templating: If I have a
then in the response body a |
Hey @ttiurani I spotted where the problem is, the Hoverfly matching logic converts the header names to lower case, which somehow upset Nginx. Cloning the headers before matching should fix it: #945 Also removing the bit that reconstructs request, because we can just forward the original request if no matching simulation found |
I've created another issue to keep track of the related bug |
Thanks for the fixes! However, I did unfortunately now bump into a new bug:
and nothing actually gets sent to nginx. I did build this myself, so first I thought this was about me somehow building the linux/amd64 binary wrong, but then I tried to build the commit 9a0eee5 and did manage to get the same 400 error from nginx just fine. So did your "Also removing the bit that reconstructs request" part perhaps now lose the original scheme? @tommysitu |
Oh no, what request did you make? |
It's the original involved code I used to find this bug, the body of a POST is big in this one, it is I didn't yet try without |
I created a new issue about this to #948 – without |
The repository:
https://github.com/ttiurani/hoverflybug
contains instructions on how to reproduce with a local docker the bug with nginx's default
proxy_pass
not working with Hoverfly spy mode, when doing a PUT/POST with a body and there being a "headers" request matcher in Hoverfly's simulation file. Nginx fails the request Hoverfly sends with 400, where without hoverfly as proxy – or without any "headers" request matchers – things work.Replicates with the latest Hoverfly.
The text was updated successfully, but these errors were encountered: