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

◆ CheckBadHeaderValueChars() [2/2]

static string System.Net.HttpValidationHelpers.CheckBadHeaderValueChars ( string value)
inlinestatic

Definition at line 32 of file HttpValidationHelpers.cs.

33 {
34 if (string.IsNullOrEmpty(value))
35 {
36 return string.Empty;
37 }
39 int num = 0;
40 for (int i = 0; i < value.Length; i++)
41 {
42 char c = (char)(0xFFu & value[i]);
43 switch (num)
44 {
45 case 0:
46 if (c == '\r')
47 {
48 num = 1;
49 }
50 else if (c == '\n')
51 {
52 num = 2;
53 }
54 else if (c == '\u007f' || (c < ' ' && c != '\t'))
55 {
57 }
58 break;
59 case 1:
60 if (c == '\n')
61 {
62 num = 2;
63 break;
64 }
66 case 2:
67 if (c == ' ' || c == '\t')
68 {
69 num = 0;
70 break;
71 }
73 }
74 }
75 if (num != 0)
76 {
78 }
79 return value;
80 }
static readonly char[] s_httpTrimCharacters
static string net_WebHeaderInvalidCRLFChars
Definition SR.cs:72
static string net_WebHeaderInvalidControlChars
Definition SR.cs:102
Definition SR.cs:7

References System.SR.net_WebHeaderInvalidControlChars, System.SR.net_WebHeaderInvalidCRLFChars, System.Net.HttpValidationHelpers.s_httpTrimCharacters, and System.value.