/// <summary> /// Full constructor. /// </summary> /// <param name="innerHandler">The next handler in the pipeline to process requests.</param> /// <param name="maxRedirects">The maximum number of automatic redirections for the handler to follow per request.</param> /// <param name="redirectCache">A <see cref="RedirectCache"/> instance to use for caching known redirects.</param> /// <exception cref="System.ArgumentNullException">Thrown if the <paramref name="innerHandler"/> is null.</exception> /// <exception cref="System.ArgumentOutOfRangeException">Thrown if <paramref name="maxRedirects"/> is less than zero.</exception> public InsecureRedirectionHandler(HttpMessageHandler innerHandler, int maxRedirects, IRedirectCache redirectCache) : base(innerHandler) { if (innerHandler == null) { throw new ArgumentNullException(nameof(innerHandler)); } if (maxRedirects < 0) { throw new ArgumentOutOfRangeException(nameof(maxRedirects)); } MaxRedirects = maxRedirects; _RedirectCache = redirectCache ?? new RedirectCache(); }
/// <summary> /// Full constructor. /// </summary> /// <param name="innerFilter">The next handler in the pipeline to process requests.</param> /// <param name="maxRedirects">The maximum number of automatic redirections for the handler to follow per request.</param> /// <param name="redirectCache">A <see cref="RedirectCache"/> instance to use for caching known redirects.</param> /// <exception cref="System.ArgumentNullException">Thrown if the <paramref name="innerFilter"/> is null.</exception> /// <exception cref="System.ArgumentOutOfRangeException">Thrown if <paramref name="maxRedirects"/> is less than zero.</exception> public InsecureRedirectionFilter(IHttpFilter innerFilter, int maxRedirects, IRedirectCache redirectCache) { if (innerFilter == null) { throw new ArgumentNullException(nameof(innerFilter)); } if (maxRedirects < 0) { throw new ArgumentOutOfRangeException(nameof(maxRedirects)); } _InnerFilter = innerFilter; MaxRedirects = maxRedirects; _RedirectCache = redirectCache ?? new RedirectCache(); }
/// <summary> /// Full constructor. /// </summary> /// <param name="innerHandler">The next handler in the pipeline to process requests.</param> /// <param name="maxRedirects">The maximum number of automatic redirections for the handler to follow per request.</param> /// <param name="redirectCache">A <see cref="RedirectCache"/> instance to use for caching known redirects.</param> /// <exception cref="System.ArgumentNullException">Thrown if the <paramref name="innerHandler"/> is null.</exception> /// <exception cref="System.ArgumentOutOfRangeException">Thrown if <paramref name="maxRedirects"/> is less than zero.</exception> public InsecureRedirectionHandler(HttpMessageHandler innerHandler, int maxRedirects, IRedirectCache redirectCache) : base(innerHandler) { Helper.Throw(); }