/// <summary>
 /// Invokes the middleware.
 /// </summary>
 /// <param name="context">The <see cref="HttpContext"/> of the request.</param>
 /// <returns>
 /// A <see cref="Task"/> that represents the completion of request processing.
 /// </returns>
 public async Task Invoke(HttpContext context)
 {
     if (await _provider.Accept(context))
     {
         return;
     }
     _provider.AddHstsHeader(context);
     await _next.Invoke(context);
 }
        /// <summary>
        /// Invokes the middleware.
        /// </summary>
        /// <param name="context">The <see cref="HttpContext"/> of the request.</param>
        /// <returns>
        /// A <see cref="Task"/> that represents the completion of request processing.
        /// </returns>
        public async Task Invoke(HttpContext context)
        {
            var sslContext = new SslRedirectContext(context, _options);

            if (await _provider.Accept(sslContext))
            {
                return;
            }
            _provider.AddHstsHeader(sslContext);
            await _next.Invoke(context);
        }