Skip to content

Fix: handle chunked HTTP responses in client#7

Open
echobt wants to merge 1 commit intomainfrom
fix/issue-38-http-chunked
Open

Fix: handle chunked HTTP responses in client#7
echobt wants to merge 1 commit intomainfrom
fix/issue-38-http-chunked

Conversation

@echobt
Copy link
Copy Markdown
Contributor

@echobt echobt commented Jan 19, 2026

Summary

  • Parse HTTP headers to respect Transfer-Encoding and Content-Length.
  • Decode chunked bodies before JSON deserialization.
  • Reuse a response body reader for search and embed_batch.

Problem

The TCP-based client ignored Transfer-Encoding and Content-Length, so chunked responses included size markers in the body and broke JSON parsing.

Solution

Read the status line and headers, detect chunked encoding or a content length, decode the body accordingly, then parse JSON.

Testing

  • cargo fmt --check --manifest-path C:\Users\Hi\PROJECTS\temp_gXLtjamd\Cargo.toml
  • cargo clippy --all-targets --all-features --manifest-path C:\Users\Hi\PROJECTS\temp_gXLtjamd\Cargo.toml (failed: missing libclang.dll)
  • cargo test --manifest-path C:\Users\Hi\PROJECTS\temp_gXLtjamd\Cargo.toml (failed: missing libclang.dll)

Related Issue

Fixes PlatformNetwork/bounty-challenge#38

echobt added a commit that referenced this pull request Jan 19, 2026
…main--components--term-challenge

chore(main): release 0.2.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] HTTP Client Doesn't Handle Chunked Transfer-Encoding

1 participant