def METHOD_NAME(self, header_string):
    if not header_string:
        return {}
    try:
        header_feature_flags = json.loads(header_string)
    except json.JSONDecodeError:
        raise errors.InvalidArgumentError(
            "X-TensorBoard-Feature-Flags cannot be JSON decoded."
        )
    if not isinstance(header_feature_flags, dict):
        raise errors.InvalidArgumentError(
            "X-TensorBoard-Feature-Flags cannot be decoded to a dict."
        )
    return header_feature_flags