Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
HttpRequestHeaders.cs
Go to the documentation of this file.
2
3public sealed class HttpRequestHeaders : HttpHeaders
4{
5 private object[] _specialCollectionsSlots;
6
8
10
11 private bool _expectContinueSet;
12
14
16
18
20
32
34
35 public bool? ExpectContinue
36 {
37 get
38 {
40 {
41 if (ExpectCore.IsSpecialValueSet)
42 {
43 return true;
44 }
46 {
47 return false;
48 }
49 }
50 return null;
51 }
52 set
53 {
54 if (value == true)
55 {
56 _expectContinueSet = true;
57 ExpectCore.SetSpecialValue();
58 }
59 else
60 {
61 _expectContinueSet = value.HasValue;
62 ExpectCore.RemoveSpecialValue();
63 }
64 }
65 }
66
67 public string? From
68 {
69 get
70 {
71 return (string)GetParsedValues(KnownHeaders.From.Descriptor);
72 }
73 set
74 {
75 if (value == string.Empty)
76 {
77 value = null;
78 }
81 }
82 }
83
84 public string? Host
85 {
86 get
87 {
88 return (string)GetParsedValues(KnownHeaders.Host.Descriptor);
89 }
90 set
91 {
92 if (value == string.Empty)
93 {
94 value = null;
95 }
96 if (value != null && HttpRuleParser.GetHostLength(value, 0, allowToken: false, out var _) != value.Length)
97 {
99 }
101 }
102 }
103
105
107 {
108 get
109 {
111 }
112 set
113 {
115 }
116 }
117
119
121 {
122 get
123 {
125 }
126 set
127 {
129 }
130 }
131
133 {
134 get
135 {
137 }
138 set
139 {
141 }
142 }
143
144 public int? MaxForwards
145 {
146 get
147 {
148 object parsedValues = GetParsedValues(KnownHeaders.MaxForwards.Descriptor);
149 if (parsedValues != null)
150 {
151 return (int)parsedValues;
152 }
153 return null;
154 }
155 set
156 {
158 }
159 }
160
172
174 {
175 get
176 {
178 }
179 set
180 {
182 }
183 }
184
185 public Uri? Referrer
186 {
187 get
188 {
189 return (Uri)GetParsedValues(KnownHeaders.Referer.Descriptor);
190 }
191 set
192 {
194 }
195 }
196
198
200
202
204 {
205 get
206 {
208 }
209 set
210 {
211 GeneralHeaders.CacheControl = value;
212 }
213 }
214
216
217 public bool? ConnectionClose
218 {
219 get
220 {
222 }
223 set
224 {
225 GeneralHeaders.ConnectionClose = value;
226 }
227 }
228
230 {
231 get
232 {
233 return GeneralHeaders.Date;
234 }
235 set
236 {
237 GeneralHeaders.Date = value;
238 }
239 }
240
242
244
246
248 {
249 get
250 {
252 }
253 set
254 {
255 GeneralHeaders.TransferEncodingChunked = value;
256 }
257 }
258
260
262
264
266
267 private T GetSpecializedCollection<T>(int slot, Func<HttpRequestHeaders, T> creationFunc)
268 {
269 if (_specialCollectionsSlots == null)
270 {
271 _specialCollectionsSlots = new object[8];
272 }
273 object[] specialCollectionsSlots = _specialCollectionsSlots;
274 return (T)(specialCollectionsSlots[slot] ?? (specialCollectionsSlots[slot] = creationFunc(this)));
275 }
276
281
282 internal override void AddHeaders(HttpHeaders sourceHeaders)
283 {
284 base.AddHeaders(sourceHeaders);
285 HttpRequestHeaders httpRequestHeaders = sourceHeaders as HttpRequestHeaders;
286 if (httpRequestHeaders._generalHeaders != null)
287 {
289 }
290 if (!ExpectContinue.HasValue)
291 {
292 ExpectContinue = httpRequestHeaders.ExpectContinue;
293 }
294 }
295}
static readonly NameValueWithParametersHeaderValue ExpectContinue
static ? DateTimeOffset GetDateTimeOffsetValue(HeaderDescriptor descriptor, HttpHeaders store, DateTimeOffset? defaultValue=null)
HttpHeaderValueCollection< WarningHeaderValue > Warning
static ? bool GetConnectionClose(HttpHeaders parent, HttpGeneralHeaders headers)
HttpHeaderValueCollection< ProductHeaderValue > Upgrade
static ? bool GetTransferEncodingChunked(HttpHeaders parent, HttpGeneralHeaders headers)
HttpHeaderValueCollection< string > Trailer
HttpHeaderValueCollection< NameValueHeaderValue > Pragma
HttpHeaderValueCollection< ViaHeaderValue > Via
void AddSpecialsFrom(HttpGeneralHeaders sourceHeaders)
HttpHeaderValueCollection< string > Connection
HttpHeaderValueCollection< TransferCodingHeaderValue > TransferEncoding
static void CheckContainsNewLine(string value)
bool ContainsParsedValue(HeaderDescriptor descriptor, object value)
void SetOrRemoveParsedValue(HeaderDescriptor descriptor, object value)
object GetParsedValues(HeaderDescriptor descriptor)
T GetSpecializedCollection< T >(int slot, Func< HttpRequestHeaders, T > creationFunc)
HttpHeaderValueCollection< EntityTagHeaderValue > IfMatch
HttpHeaderValueCollection< NameValueWithParametersHeaderValue > _expect
HttpHeaderValueCollection< NameValueHeaderValue > Pragma
HttpHeaderValueCollection< WarningHeaderValue > Warning
HttpHeaderValueCollection< NameValueWithParametersHeaderValue > ExpectCore
HttpHeaderValueCollection< string > Trailer
HttpHeaderValueCollection< EntityTagHeaderValue > IfNoneMatch
HttpHeaderValueCollection< StringWithQualityHeaderValue > AcceptEncoding
HttpHeaderValueCollection< MediaTypeWithQualityHeaderValue > Accept
override void AddHeaders(HttpHeaders sourceHeaders)
HttpHeaderValueCollection< ViaHeaderValue > Via
HttpHeaderValueCollection< StringWithQualityHeaderValue > AcceptLanguage
HttpHeaderValueCollection< TransferCodingWithQualityHeaderValue > TE
HttpHeaderValueCollection< string > Connection
HttpHeaderValueCollection< ProductInfoHeaderValue > UserAgent
HttpHeaderValueCollection< ProductHeaderValue > Upgrade
HttpHeaderValueCollection< NameValueWithParametersHeaderValue > Expect
HttpHeaderValueCollection< StringWithQualityHeaderValue > AcceptCharset
static readonly KnownHeader ProxyAuthorization
static readonly KnownHeader IfModifiedSince
static readonly KnownHeader Referer
static readonly KnownHeader Host
static readonly KnownHeader IfUnmodifiedSince
static readonly KnownHeader IfRange
static readonly KnownHeader Expect
static readonly KnownHeader AcceptLanguage
static readonly KnownHeader IfNoneMatch
static readonly KnownHeader Accept
static readonly KnownHeader IfMatch
static readonly KnownHeader UserAgent
static readonly KnownHeader AcceptCharset
static readonly KnownHeader AcceptEncoding
static readonly KnownHeader TE
static readonly KnownHeader MaxForwards
static readonly KnownHeader Authorization
static readonly KnownHeader Range
static readonly KnownHeader From
static int GetHostLength(string input, int startIndex, bool allowToken, out string host)
static string net_http_headers_invalid_host_header
Definition SR.cs:30
Definition SR.cs:7