MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / serve_favicon

Method serve_favicon

utils.py:398–410  ·  view source on GitHub ↗
(self, handler)

Source from the content-addressed store, hash-verified

396
397
398 def serve_favicon(self, handler):
399 handler.send_response(200)
400 handler.send_header("Content-type", "image/x-icon")
401 handler.end_headers()
402 favicon_path = os.path.join(self.shared_data.webdir, '/images/favicon.ico')
403 self.logger.info(f"Serving favicon from {favicon_path}")
404 try:
405 with open(favicon_path, 'rb') as file:
406 handler.wfile.write(file.read())
407 except FileNotFoundError:
408 self.logger.error(f"Favicon not found at {favicon_path}")
409 handler.send_response(404)
410 handler.end_headers()
411
412 def serve_manifest(self, handler):
413 handler.send_response(200)

Callers

nothing calls this directly

Calls 4

infoMethod · 0.80
errorMethod · 0.80
writeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected