Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CheckValueFormat()

static void System.Net.Http.Headers.NameValueHeaderValue.CheckValueFormat ( string value)
inlinestaticprivateinherited

Definition at line 266 of file NameValueHeaderValue.cs.

267 {
268 if (string.IsNullOrEmpty(value))
269 {
270 return;
271 }
272 if (value[0] == ' ' || value[0] == '\t' || value[^1] == ' ' || value[^1] == '\t')
273 {
274 ThrowFormatException(value);
275 }
276 if (value[0] == '"')
277 {
278 if (HttpRuleParser.GetQuotedStringLength(value, 0, out var length) != 0 || length != value.Length)
279 {
280 ThrowFormatException(value);
281 }
282 }
283 else if (HttpRuleParser.ContainsNewLine(value))
284 {
285 ThrowFormatException(value);
286 }
287 static void ThrowFormatException(string value)
288 {
290 }
291 }
static CultureInfo InvariantCulture
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string net_http_headers_invalid_value
Definition SR.cs:26
Definition SR.cs:7

References System.Net.Http.HttpRuleParser.ContainsNewLine(), System.SR.Format(), System.Net.Http.HttpRuleParser.GetQuotedStringLength(), System.Globalization.CultureInfo.InvariantCulture, System.length, System.SR.net_http_headers_invalid_value, and System.value.

Referenced by System.Net.Http.Headers.NameValueHeaderValue.CheckNameValueFormat().