Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/mcp/shared/inbound.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"""

import base64
import binascii
import re
from collections.abc import Iterable, Iterator, Mapping, Sequence
from dataclasses import dataclass
Expand Down Expand Up @@ -176,7 +175,7 @@ def decode_header_value(value: str | None) -> str | None:
payload = m.group("payload")
try:
decoded = base64.b64decode(payload, validate=True)
except binascii.Error:
except ValueError:
return None
# Reject non-canonical base64 (e.g. non-zero trailing bits), which
# `validate=True` tolerates; the encoder only ever emits canonical form.
Expand Down
Loading