docs: async def _preflight_handler(self, request: web.Request):
          """CORS preflight request handler"""
  
          # Handle according to part 6.2 of the CORS specification.
  
          origin = request.headers.get(hdrs.ORIGIN)
          if origin is None:
              # Terminate CORS according to CORS 6.2.1.
              raise web.HTTPForbidden(
                  text="CORS preflight request failed: "
                       "origin header is not specified in the request")
  
          # CORS 6.2.3. Doing it out of order is not an error.
          request_method = self._parse_request_method(request)
  
          # CORS 6.2.5. Doing it out of order is not an error.
  
          try:
              config = \
                  await self._get_config(request, origin, request_method)
          except KeyError:
              raise web.HTTPForbidden(
                  text="CORS preflight request failed: "
                       "request method {!r} is not allowed "
                       "for {!r} origin".format(request_method, origin))
  
          if not config:
              # No allowed origins for the route.
              # Terminate CORS according to CORS 6.2.1.
              raise web.HTTPForbidden(
                  text="CORS preflight request failed: "
                       "no origins are allowed")
  
          options = config.get(origin, config.get("*"))
          if options is None:
              # No configuration for the origin - deny.
              # Terminate CORS according to CORS 6.2.2.
              raise web.HTTPForbidden(
                  text="CORS preflight request failed: "
                       "origin '{}' is not allowed".format(origin))
  
          # CORS 6.2.4
          request_headers = self._parse_request_headers(request)
  
          # CORS 6.2.6
          if options.allow_headers == "*":
              pass
          else:
              disallowed_headers = request_headers - options.allow_headers
              if disallowed_headers:
                  raise web.HTTPForbidden(
                      text="CORS preflight request failed: "
                           "headers are not allowed: {}".format(
                               ", ".join(disallowed_headers)))
  
          # Ok, CORS actual request with specified in the preflight request
          # parameters is allowed.
          # Set appropriate headers and return 200 response.
  
          response = web.Response()
  
          # CORS 6.2.7
          response.headers[hdrs.ACCESS_CONTROL_ALLOW_ORIGIN] = origin
          if options.allow_credentials:
              # Set allowed credentials.
              response.headers[hdrs.ACCESS_CONTROL_ALLOW_CREDENTIALS] = _TRUE
  
          # CORS 6.2.8
          if options.max_age is not None:
              response.headers[hdrs.ACCESS_CONTROL_MAX_AGE] = \
                  str(options.max_age)
  
          # CORS 6.2.9
          # TODO: more optimal for client preflight request cache would be to
          # respond with ALL allowed methods.
          response.headers[hdrs.ACCESS_CONTROL_ALLOW_METHODS] = request_method
  
          # CORS 6.2.10
          if request_headers:
              # Note: case of the headers in the request is changed, but this
              # shouldn't be a problem, since the headers should be compared in
              # the case-insensitive way.
              response.headers[hdrs.ACCESS_CONTROL_ALLOW_HEADERS] = \
                  ",".join(request_headers)
  
          return response