Skip to content

Commit 66deb5e

Browse files
author
Tarek Mahmoud Sayed
committed
Fix misleading comment on Base64 prefix case sensitivity
The comment incorrectly stated the case-insensitive prefix check was per the SEP. The spec defines lowercase '=?base64?' only; the SDK intentionally matches case-insensitively for robustness against non-conforming senders.
1 parent 5f4735b commit 66deb5e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/ModelContextProtocol.Core/Protocol/McpHeaderEncoder.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ public static class McpHeaderEncoder
119119
return headerValue;
120120
}
121121

122-
// Check for Base64 wrapper (case-insensitive prefix check per SEP)
122+
// Check for Base64 wrapper. The spec defines the prefix as lowercase "=?base64?"
123+
// but we match case-insensitively for robustness against non-conforming senders.
123124
if (headerValue.StartsWith(Base64Prefix, StringComparison.OrdinalIgnoreCase) &&
124125
headerValue.EndsWith(Base64Suffix, StringComparison.Ordinal))
125126
{

0 commit comments

Comments
 (0)