Skip to content

Add ContentType support for Blob and Chunk resources#68

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/add-content-type-to-blob-chunk
Draft

Add ContentType support for Blob and Chunk resources#68
Copilot wants to merge 2 commits intomainfrom
copilot/add-content-type-to-blob-chunk

Conversation

Copy link
Contributor

Copilot AI commented Nov 17, 2025

Adds fields to track and forward Content-Type headers from source to destination during blob transfers.

Changes

  • BlobStatus.ContentType: Captures Content-Type from source HEAD response
  • ChunkSpec.SourceResponseHeadersToDestination: Whitelist of source headers to forward to destinations
  • blob_from_chunk_controller: Extracts Content-Type during HEAD chunk processing
  • blob_to_chunk_controller: Sets header forwarding list when ContentType is known
  • chunk_runner: Implements header forwarding from source response to destination requests

Example

// BlobStatus now includes content type from source
type BlobStatus struct {
    Total        int64  `json:"total,omitempty"`
    ContentType  string `json:"contentType,omitempty"`  // New field
    // ...
}

// ChunkSpec specifies which headers to forward
type ChunkSpec struct {
    Source      ChunkHTTP   `json:"source"`
    Destination []ChunkHTTP `json:"destination,omitempty"`
    SourceResponseHeadersToDestination []string `json:"sourceResponseHeadersToDestination,omitempty"`  // New field
    // ...
}

When a blob has a known ContentType, chunks are created with SourceResponseHeadersToDestination: ["Content-Type"], causing the runner to forward the Content-Type header from source to all destination PUT requests.

Original prompt

This section details on the original issue you should resolve

<issue_title>Support ContentType for blob and chunk</issue_title>
<issue_description>- Add a field to the Chunk to describe which Source's response headers are passed to the Destination

  • Add a field to the Blob that respects the ContentType of the source.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Support ContentType for blob and chunk Add ContentType support for Blob and Chunk resources Nov 17, 2025
Copilot AI requested a review from wzshiming November 17, 2025 07:44
@wzshiming wzshiming force-pushed the main branch 4 times, most recently from 890c265 to 94c6dc6 Compare November 21, 2025 11:33
Copilot AI and others added 2 commits December 23, 2025 16:58
- Add SourceResponseHeadersToDestination field to ChunkSpec to specify headers to forward
- Update blob_from_chunk_controller to extract ContentType from HEAD responses
- Update blob_to_chunk_controller to set SourceResponseHeadersToDestination with Content-Type
- Update chunk_runner to forward specified source headers to destination requests
- Regenerate API code (deepcopy, openapi, clientset, etc.)

Co-authored-by: wzshiming <6565744+wzshiming@users.noreply.github.com>
@wzshiming wzshiming force-pushed the copilot/add-content-type-to-blob-chunk branch from c49eb78 to 5650131 Compare December 25, 2025 01:38
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.

Support ContentType for blob and chunk

2 participants