|
|
@@ -564,7 +564,12 @@ def _require_bounded_text(value: str, label: str, maximum: int) -> None:
|
|
|
"TASK_CONTRACT_INVALID", f"{label} must contain between 1 and {maximum} characters"
|
|
|
)
|
|
|
lowered = value.casefold()
|
|
|
- if "data:" in lowered or _LONG_BASE64.search(value):
|
|
|
+ encoded_blob = (
|
|
|
+ any(_LONG_BASE64.fullmatch(segment) for segment in value.split("/"))
|
|
|
+ if value.startswith(_CONTROL_URI_PREFIX)
|
|
|
+ else _LONG_BASE64.search(value) is not None
|
|
|
+ )
|
|
|
+ if "data:" in lowered or encoded_blob:
|
|
|
raise TaskContractError(
|
|
|
"TASK_CONTRACT_INVALID", f"{label} must not embed encoded candidate content"
|
|
|
)
|