Skip to content

Conversation

kerobbi
Copy link
Contributor

@kerobbi kerobbi commented Oct 6, 2025

This PR fixes binary file corruption in the get_file_contents tool by tightening content-type detection logic.

Closes: #1168

@kerobbi kerobbi requested a review from a team as a code owner October 6, 2025 16:12
@Copilot Copilot AI review requested due to automatic review settings October 6, 2025 16:12
Copy link
Contributor

@Copilot 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 fixes binary file corruption in the get_file_contents tool by improving content-type detection logic to properly differentiate between text and binary content types.

  • Replaced broad application/* prefix matching with specific text content type detection
  • Added comprehensive test coverage for PDF binary file handling

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pkg/github/repositories.go Updated content-type detection logic to properly identify text vs binary content
pkg/github/repositories_test.go Added test case for PDF file retrieval to verify binary content handling

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@mattdholloway mattdholloway left a comment

Choose a reason for hiding this comment

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

lgtm!

@kerobbi kerobbi merged commit dee5927 into main Oct 7, 2025
16 checks passed
@kerobbi kerobbi deleted the kerobbi/fix-binary-content-corruption branch October 7, 2025 15:08
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 in mimeType handling in get_file_contents
2 participants