code: def process_origin(
          headers: Headers, origins: Optional[Sequence[Optional[Origin]]] = None
      ) -> Optional[Origin]:
          
          # "The user agent MUST NOT include more than one Origin header field"
          # per https://tools.ietf.org/html/rfc6454#section-7.3.
          try:
              origin = cast(Origin, headers.get("Origin"))
          except MultipleValuesError:
              raise InvalidHeader("Origin", "more than one Origin header found")
          if origins is not None:
              if origin not in origins:
                  raise InvalidOrigin(origin)
          return origin
docs: Handle the Origin HTTP request header.
  
          Raise :exc:`~websockets.exceptions.InvalidOrigin` if the origin isn't
          acceptable.