INNER CODE UNIT · Python

guess_content_type

witchan/ios-mcp · scripts/submit_bigboss_update.py:94

def guess_content_type(path: Path) -> str:
    if path.suffix == ".deb":
        return "application/vnd.debian.binary-package"
    guessed, _ = mimetypes.guess_type(path.name)
    return guessed or "application/octet-stream"


def multipart_body(
    fields: Iterable[tuple[str, str]],
    file_field: str,
    file_path: Path,
) -> tuple[bytes, str]:
    boundary = f"----ios-mcp-bigboss-{uuid.uuid4().hex}"
    chunks: list[bytes] = []

    for name, value in fields:
        chunks.append(f"--{boundary}\r\n".encode("utf-8"))
        chunks.append(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…