|
1 | 1 | using RestSharp.Extensions;
|
2 |
| -using System; |
3 |
| -using System.Collections.Generic; |
4 | 2 | using System.Net;
|
5 | 3 | using System.Reflection;
|
6 |
| -using System.Text; |
7 | 4 |
|
8 |
| -namespace RestSharp.Options { |
9 |
| - [GenerateImmutable] |
10 |
| - public class RestClientRedirectionOptions { |
11 |
| - static readonly Version Version = new AssemblyName(typeof(RestClientOptions).Assembly.FullName!).Version!; |
| 5 | +namespace RestSharp; |
12 | 6 |
|
13 |
| - public bool FollowRedirects { get; set; } = true; |
14 |
| - public bool FollowRedirectsToInsecure { get; set; } = false; |
15 |
| - public bool ForwardHeaders { get; set; } = true; |
16 |
| - public bool ForwardAuthorization { get; set; } = false; |
17 |
| - public bool ForwardCookies { get; set; } = true; |
18 |
| - public bool ForwardBody { get; set; } = true; |
19 |
| - public bool ForwardQuery { get; set; } = true; |
20 |
| - public int MaxRedirects { get; set; } |
21 |
| - public bool ForwardFragment { get; set; } = true; |
22 |
| - public IReadOnlyList<HttpStatusCode> RedirectStatusCodes { get; set; } |
| 7 | +[GenerateImmutable] |
| 8 | +public class RestClientRedirectionOptions { |
| 9 | + static readonly Version Version = new AssemblyName(typeof(RestClientOptions).Assembly.FullName!).Version!; |
23 | 10 |
|
24 |
| - public RestClientRedirectionOptions() { |
25 |
| - RedirectStatusCodes = new List<HttpStatusCode>() { |
26 |
| - HttpStatusCode.MovedPermanently, |
27 |
| - HttpStatusCode.SeeOther, |
28 |
| - HttpStatusCode.TemporaryRedirect, |
29 |
| - HttpStatusCode.Redirect, |
30 |
| - #if NET |
31 |
| - HttpStatusCode.PermanentRedirect, |
32 |
| - #endif |
33 |
| - }.AsReadOnly(); |
34 |
| - } |
| 11 | + public bool FollowRedirects { get; set; } = true; |
| 12 | + public bool FollowRedirectsToInsecure { get; set; } = false; |
| 13 | + public bool ForwardHeaders { get; set; } = true; |
| 14 | + public bool ForwardAuthorization { get; set; } = false; |
| 15 | + public bool ForwardCookies { get; set; } = true; |
| 16 | + public bool ForwardBody { get; set; } = true; |
| 17 | + public bool ForwardQuery { get; set; } = true; |
| 18 | + public int MaxRedirects { get; set; } |
| 19 | + public bool ForwardFragment { get; set; } = true; |
| 20 | + public IReadOnlyList<HttpStatusCode> RedirectStatusCodes { get; set; } |
| 21 | + |
| 22 | + public RestClientRedirectionOptions() { |
| 23 | + RedirectStatusCodes = new List<HttpStatusCode>() { |
| 24 | + HttpStatusCode.MovedPermanently, |
| 25 | + HttpStatusCode.SeeOther, |
| 26 | + HttpStatusCode.TemporaryRedirect, |
| 27 | + HttpStatusCode.Redirect, |
| 28 | +#if NET |
| 29 | + HttpStatusCode.PermanentRedirect, |
| 30 | +#endif |
| 31 | + }.AsReadOnly(); |
35 | 32 | }
|
36 | 33 | }
|
| 34 | + |
0 commit comments