Skip to content

Conversation

@ryanfowler
Copy link
Owner

No description provided.

@ryanfowler ryanfowler requested a review from Copilot January 15, 2026 02:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances multipart file upload functionality by intelligently detecting and setting content-type headers for files. Instead of using a generic content-type, the implementation now attempts to determine the correct MIME type by checking file extensions first, then falling back to content sniffing for extensionless files.

Changes:

  • Added intelligent content-type detection for multipart file uploads via extension mapping and content sniffing
  • Refactored file upload logic into a dedicated writeFilePart function
  • Added comprehensive test coverage for the new content-type detection behavior

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
internal/multipart/multipart.go Implements content-type detection via extension mapping and content sniffing, refactors file writing into writeFilePart function
internal/multipart/multipart_test.go Adds unit tests for content-type detection with JSON files and extensionless JPEG files
integration/integration_test.go Updates integration test to verify JPEG content-type detection using JPEG signature bytes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ryanfowler ryanfowler merged commit a5097b7 into main Jan 15, 2026
10 checks passed
@ryanfowler ryanfowler deleted the multipart-content-type branch January 15, 2026 02:31
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.

2 participants