(url)
| 9 | from PIL import Image |
| 10 | |
| 11 | def image_url_is_on_localhost(url): |
| 12 | local_url_identifiers = ['localhost', '0.0.0.0', '127.0.0.1', '::1'] |
| 13 | |
| 14 | if any(item in url for item in local_url_identifiers): |
| 15 | if "/imgs/" not in url: |
| 16 | raise_http_error(ErrorCode.PROVIDER_ERROR, "Invalid local image url.") |
| 17 | return True |
| 18 | |
| 19 | return False |
| 20 | |
| 21 | async def fetch_image_format(url): |
| 22 |
no test coverage detected