-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
analytics RecordHit fixed #2000
Conversation
This is a tricky code, so I decided to write a test (added to this branch). And while EOF error was solved, RawResponse field not get recorded when cache is used. |
Agree that it is tricky code, unfortunately I couldn't find better way to do a fix as the place when source Body buffer gets reset to len 0 is inside Go's standard library code. According to empty empty |
I will look into that PR changes with potentially another fix |
This reverts commit da90a42.
…cord RawResponse for cache hits
@buger PTAL |
Nice! So much clearer. |
added changes for #1996 Thus situation was happening when detailed analytics recording (copy of actual response in analytics record) is enabled. The code in RecordHit was screwing up copyResponse.Body underlaying buffer by reseting its length to 0. So item put into cache had only headers without body and it was causing that error `http: proxy error during body copy: unexpected EOF` as we use reverse-proxy code to instantiate response from cache item value.
added changes for #1996
Thus situation was happening when detailed analytics recording (copy of actual response in analytics record) is enabled.
The code in RecordHit was screwing up copyResponse.Body underlaying buffer by reseting its length to 0. So item put into cache had only headers without body and it was causing that error
http: proxy error during body copy: unexpected EOF
as we use reverse-proxy code to instantiate response from cache item value.