Skip to content

Incorrect Content-Type and Accept headers for bidirectional streaming operations in RPC v2 CBOR protocol #4421

@vikramdara

Description

@vikramdara

Describe the bug

When making API calls to bidirectional streaming operations using the RPC v2 CBOR protocol, the generated Rust client sets incorrect HTTP headers for Content-Type and Accept. Both headers are set to application/cbor instead of the expected vnd.amazon.eventstream for streaming operations.

Expected Behavior

According to the Smithy documentation, when an operation:

  • Sends an EventStreamSender in the request, the Content-Type header should be vnd.amazon.eventstream
  • Returns an EventReceiver in the response, the Accept header should be vnd.amazon.eventstream

Current Behavior

The generated client sets:

  • Content-Type: application/cbor (should be vnd.amazon.eventstream)
  • Accept: application/cbor (should be vnd.amazon.eventstream)

This causes the API call to hang indefinitely in the .await() block without returning a response.

Sample Request Headers

content-type: application/cbor 
smithy-protocol: rpc-v2-cbor 
accept: application/cbor 
x-amz-date: 20251124T171442Z 
authorization: **** 
x-amz-security-token: ****** 
amz-sdk-request: attempt=1; max=3 

Related Issue

Seems like this was an issue also on the server side, but has been fixed: #4322.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions