| 861 | |
| 862 | class ProcessImage(RequestHandler): |
| 863 | def get(self): |
| 864 | path = self.get_query_argument("path", None) |
| 865 | |
| 866 | if not path: |
| 867 | raise APIError(400, "Missing 'path' parameter.") |
| 868 | |
| 869 | try: |
| 870 | icon_bytes = mitmproxy_rs.process_info.executable_icon(path) |
| 871 | except Exception: |
| 872 | icon_bytes = TRANSPARENT_PNG |
| 873 | |
| 874 | self.set_header("Content-Type", "image/png") |
| 875 | self.set_header("X-Content-Type-Options", "nosniff") |
| 876 | self.set_header("Cache-Control", "max-age=604800") |
| 877 | self.write(icon_bytes) |
| 878 | |
| 879 | |
| 880 | class GZipContentAndFlowFiles(tornado.web.GZipContentEncoding): |