fix(sdk): reject Content-Type in default headers - #740
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Greptile SummaryThis PR prevents hidden SDK configuration from supplying a default
Confidence Score: 5/5The PR appears safe to merge with no actionable correctness, security, or repository-rule issues identified. The validation consistently rejects case-insensitive Content-Type defaults before request construction, tests the relevant value variants, and leaves operation-specific Content-Type selection intact. Important Files Changed
Reviews (1): Last reviewed commit: "fix(sdk): reject Content-Type in default..." | Re-trigger Greptile |
Summary
Reject
Content-TypeinS2Config::with_default_headers, alongside the existing encoding/framing restrictions. The SDK chooses the protocol for each operation: a defaultContent-Type: s2s/protocan make a unary read receive streaming frames, causing a decode error or timeout.This addresses #737 at configuration validation, as an alternative to the per-read override in #738. All
Content-Typevalues are rejected because request format belongs to the SDK.Extend the existing rejection tests to cover S2S, protobuf, JSON, mixed-case header names, and empty values. Remove the now-invalid Content-Type default from the header propagation fixture while preserving its assertions.
Validation: the five new cases failed before the fix.
just testpasses all 796 workspace tests; SDK clippy with all features/targets andjust fmtalso pass.Closes #737
Link to Devin session: https://app.devin.ai/sessions/c3dea6e292ce4071a41baf4943f1557c
Open in Devin Desktop: https://app.devin.ai/desktop/session/c3dea6e292ce4071a41baf4943f1557c?variant=devin
Requested by: @sgbalogh