/// <summary>
        /// Initializes a new instance of the <see cref="HttpConnectionFactory"/> class.
        /// </summary>
        /// <param name="options">The connection options.</param>
        /// <param name="loggerFactory">The logger factory.</param>
        public HttpConnectionFactory(IOptions <HttpConnectionOptions> options, ILoggerFactory loggerFactory)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            _httpConnectionOptions = options.Value;
            _loggerFactory         = loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory));
        }
 // Internal for testing
 internal static HttpConnectionOptions ShallowCopyHttpConnectionOptions(HttpConnectionOptions options)
 {
     return(new HttpConnectionOptions
     {
         HttpMessageHandlerFactory = options.HttpMessageHandlerFactory,
         Headers = options.Headers,
         ClientCertificates = options.ClientCertificates,
         Cookies = options.Cookies,
         Url = options.Url,
         Transports = options.Transports,
         SkipNegotiation = options.SkipNegotiation,
         AccessTokenProvider = options.AccessTokenProvider,
         CloseTimeout = options.CloseTimeout,
         Credentials = options.Credentials,
         Proxy = options.Proxy,
         UseDefaultCredentials = options.UseDefaultCredentials,
         DefaultTransferFormat = options.DefaultTransferFormat,
         WebSocketConfiguration = options.WebSocketConfiguration,
     });
 }