This repository was archived by the owner on Jun 5, 2025. It is now read-only.
This repository was archived by the owner on Jun 5, 2025. It is now read-only.
copilot provider doesn't handle body arriving in a different message than the headers #517
Closed
Description
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)