api_ping. Route handler or application helper. This docstring was expanded to make future maintenance easier. Returns: Varies.
()
| 13713 | # Download with a cap to avoid abuse. |
| 13714 | max_bytes = CHAT_MAX_BYTES # 33 MB |
| 13715 | size = 0 |
| 13716 | mime = "image/gif" |
| 13717 | filename = "gif.gif" |
| 13718 | |
| 13719 | req = urllib.request.Request( |
| 13720 | gif_url, |
| 13721 | headers={ |
| 13722 | "User-Agent": "ButSystem/1.0 (+https://example.invalid)", |
| 13723 | "Accept": "image/gif,image/*,video/*,*/*;q=0.8", |
| 13724 | }, |
| 13725 | method="GET", |
| 13726 | ) |
| 13727 | try: |
| 13728 | with _safe_urlopen(req, timeout=12) as resp: |
| 13729 | ctype = (resp.headers.get("Content-Type") or "").split(";")[0].strip().lower() |
nothing calls this directly
no test coverage detected