class_docstr: Http handler.
class_docstr_tok: ["Http","handler","."]
docstr: GET method handler.
docstr_tok: ["GET","method","handler","."]
code: def do_GET(self) -> None:
      """GET method handler."""
      # depending on Python version, leading / may be present or not
      path = self.path.split("?")[0]  # TODO: .removeprefix("/")
      if path.startswith("/"):
          path = path[1:]
      try:
          with open(
              HTML_ROOT / path, mode="rb"
          ) as f:  # lgtm [py/path-injection]
              self.send_response(200)
              self.send_header("Content-type", "text/html")
              self.end_headers()
              self.wfile.write(f.read())
      except OSError:
          self.send_error(404, f"File Not Found: {path}")
  
file_path: bokeh/tests/support/plugins/file_server.py
imports: from __future__ import annotations
  import logging
  import os
  import threading
  from http.server import BaseHTTPRequestHandler, HTTPServer
  from pathlib import Path
  from typing import Any
  from urllib.request import urlopen
  import pytest
label_desc: Use image node_id 1 for calling the HtmlOnlyHandler obj's underlying member method code with example usage: obj.do_GET() without return types