Skip to content

Commit 807bb92

Browse files
committed
tighten content filtering logic
1 parent bf0d62e commit 807bb92

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/github/repositories.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,13 @@ func GetFileContents(getClient GetClientFn, getRawClient raw.GetRawClientFn, t t
601601
}
602602
}
603603

604-
if strings.HasPrefix(contentType, "application") || strings.HasPrefix(contentType, "text") {
604+
// Determine if content is text or binary
605+
isTextContent := strings.HasPrefix(contentType, "text/") ||
606+
contentType == "application/json" ||
607+
strings.HasSuffix(contentType, "+json") ||
608+
strings.HasSuffix(contentType, "+xml")
609+
610+
if isTextContent {
605611
result := mcp.TextResourceContents{
606612
URI: resourceURI,
607613
Text: string(body),

0 commit comments

Comments
 (0)