Bot commited on
Commit ·
ba2ffb2
1
Parent(s): de22b07
Allow JSON responses in content validator so POST APIs succeed in Stage 1
Browse files121 unmodified lines122123124125126127128129121 unmodified linesdef has_valid_content(text: str) -> bool:"""Check if response has actual page content (not just CF block page)"""if not text or len(text) < 100:print(f"[Debug] Content too short: {len(text) if text else 0} bytes")return False# Check for common HTML elements that indicate real content121 unmodified lines122123124125126127128129130131132133134135121 unmodified linesdef has_valid_content(text: str) -> bool:"""Check if response has actual page content (not just CF block page)"""if not text:return False# If it's valid JSON, it's valid API content!trimmed = text.strip()if (trimmed.startswith('{') and trimmed.endswith('}')) or (trimmed.startswith('[') and trimmed.endswith(']')):return Trueif len(text) < 100:print(f"[Debug] Content too short: {len(text)} bytes")return False# Check for common HTML elements that indicate real content
main.py+8-2