You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in _forward_data_to_target in the copilot pipeline we pass the data through the pipeline always even if we only receive headers in one message and the body in the subsequent message. This causes the first request (headers) to bypass the pipeline because the body is empty and the request to fail in case e.g. the server checks if the body is valid JSON.
Since our pipeline needs the complete body of the request anyway, we need to buffer the whole body before forwarding it to the pipeline (if we didn't have the pipeline, we could probably just start writing the body in chunks as soon as the first piece of the body arrived)
The text was updated successfully, but these errors were encountered:
…eceived the whole body
It might happen that the proxied request arrives in two chunks - first
just the headers and then the body. In that case we would have sent just
the headers with an empty body through the pipeline which might trigger
errors like "400 Client Error", then the body would arrive in the next
chunk.
This patch changes the logic to keep the whole body in the buffer until
it is complete and can be processed by the pipeline and sent off to the
server.
Fixes: stacklok#517
in _forward_data_to_target in the copilot pipeline we pass the data through the pipeline always even if we only receive headers in one message and the body in the subsequent message. This causes the first request (headers) to bypass the pipeline because the body is empty and the request to fail in case e.g. the server checks if the body is valid JSON.
Since our pipeline needs the complete body of the request anyway, we need to buffer the whole body before forwarding it to the pipeline (if we didn't have the pipeline, we could probably just start writing the body in chunks as soon as the first piece of the body arrived)
The text was updated successfully, but these errors were encountered: