136 references to HttpRuleParser
System.Net.Http (136)
System\Net\Http\FormUrlEncodedContent.cs (1)
48HttpRuleParser.DefaultHttpEncoding.GetBytes(builder.AsSpan(), bytes);
System\Net\Http\Headers\AltSvcHeaderParser.cs (8)
109int tokenLength = HttpRuleParser.GetTokenLength(value, idx); 189int tokenLength = HttpRuleParser.GetTokenLength(value, startIndex); 303if (HttpRuleParser.GetQuotedStringLength(value, startIndex, out int quotedLength) != HttpParseResult.Parsed) 308Debug.Assert(value[startIndex] == '"' && value[startIndex + quotedLength - 1] == '"', $"{nameof(HttpRuleParser.GetQuotedStringLength)} should return {nameof(HttpParseResult.NotParsed)} if the opening/closing quotes are missing."); 396int tokenLength = HttpRuleParser.GetTokenLength(value, startIndex); 404if (HttpRuleParser.GetQuotedStringLength(value, startIndex, out int quotedLength) == HttpParseResult.Parsed) 459int tokenLength = HttpRuleParser.GetTokenLength(value, startIndex); 466if (HttpRuleParser.GetQuotedStringLength(value, startIndex, out int quotedLength) == HttpParseResult.Parsed)
System\Net\Http\Headers\AuthenticationHeaderValue.cs (9)
122if (string.IsNullOrEmpty(input) || (startIndex >= input.Length) || HttpRuleParser.ContainsNewLine(input, startIndex)) 128int schemeLength = HttpRuleParser.GetTokenLength(input, startIndex); 150int whitespaceLength = HttpRuleParser.GetWhitespaceLength(input, current); 203if (HttpRuleParser.GetQuotedStringLength(input, current, out quotedStringLength) != 214int whitespaceLength = HttpRuleParser.GetWhitespaceLength(input, current); 253int tokenLength = HttpRuleParser.GetTokenLength(input, current); 260current += HttpRuleParser.GetWhitespaceLength(input, current); 271current += HttpRuleParser.GetWhitespaceLength(input, current); 284current += HttpRuleParser.GetWhitespaceLength(input, current);
System\Net\Http\Headers\CacheControlHeaderValue.cs (1)
520int tokenLength = HttpRuleParser.GetTokenLength(valueString, current);
System\Net\Http\Headers\ContentDispositionHeaderValue.cs (3)
229current += HttpRuleParser.GetWhitespaceLength(input, current); 263int typeLength = HttpRuleParser.GetTokenLength(input, startIndex); 415else if (!needsQuotes && HttpRuleParser.GetTokenLength(result, 0) != result.Length)
System\Net\Http\Headers\ContentRangeHeaderValue.cs (13)
169int unitLength = HttpRuleParser.GetTokenLength(input, startIndex); 178int separatorLength = HttpRuleParser.GetWhitespaceLength(input, current); 209current += HttpRuleParser.GetWhitespaceLength(input, current); 244lengthLength = HttpRuleParser.GetNumberLength(input, current, false); 246if ((lengthLength == 0) || (lengthLength > HttpRuleParser.MaxInt64Digits)) 254current += HttpRuleParser.GetWhitespaceLength(input, current); 274fromLength = HttpRuleParser.GetNumberLength(input, current, false); 276if ((fromLength == 0) || (fromLength > HttpRuleParser.MaxInt64Digits)) 282current += HttpRuleParser.GetWhitespaceLength(input, current); 292current += HttpRuleParser.GetWhitespaceLength(input, current); 301toLength = HttpRuleParser.GetNumberLength(input, current, false); 303if ((toLength == 0) || (toLength > HttpRuleParser.MaxInt64Digits)) 311current += HttpRuleParser.GetWhitespaceLength(input, current);
System\Net\Http\Headers\EntityTagHeaderValue.cs (3)
120current += HttpRuleParser.GetWhitespaceLength(input, current); 123if (current == input.Length || HttpRuleParser.GetQuotedStringLength(input, current, out int tagLength) != HttpParseResult.Parsed) 135current += HttpRuleParser.GetWhitespaceLength(input, current);
System\Net\Http\Headers\GenericHeaderParser.cs (3)
122if (HttpRuleParser.ContainsNewLine(value, startIndex)) 136int hostLength = HttpRuleParser.GetHostLength(value, startIndex, false); 144int resultLength = HttpRuleParser.GetTokenLength(value, startIndex);
System\Net\Http\Headers\HeaderDescriptor.cs (4)
70if (!HttpRuleParser.IsToken(headerName)) 92if (!HttpRuleParser.IsToken(headerName)) 98descriptor = new HeaderDescriptor(HttpRuleParser.GetTokenString(headerName)); 172return (valueEncoding ?? HttpRuleParser.DefaultHttpEncoding).GetString(headerValue);
System\Net\Http\Headers\HeaderUtilities.cs (6)
147if (!HttpRuleParser.IsToken(value)) 157if ((HttpRuleParser.GetCommentLength(value, 0, out int length) != HttpParseResult.Parsed) || 168if ((HttpRuleParser.GetQuotedStringLength(value, 0, out int length) != HttpParseResult.Parsed) || 248int current = startIndex + HttpRuleParser.GetWhitespaceLength(input, startIndex); 259current += HttpRuleParser.GetWhitespaceLength(input, current); 266current += HttpRuleParser.GetWhitespaceLength(input, current);
System\Net\Http\Headers\HttpHeaders.cs (2)
802if (HttpRuleParser.ContainsNewLine(rawValue)) 1130if (HttpRuleParser.ContainsNewLine(value))
System\Net\Http\Headers\HttpRequestHeaders.cs (1)
117if ((value != null) && (HttpRuleParser.GetHostLength(value, 0, false) != value.Length))
System\Net\Http\Headers\Int32NumberHeaderParser.cs (2)
36int numberLength = HttpRuleParser.GetNumberLength(value, startIndex, false); 38if ((numberLength == 0) || (numberLength > HttpRuleParser.MaxInt32Digits))
System\Net\Http\Headers\Int64NumberHeaderParser.cs (2)
36int numberLength = HttpRuleParser.GetNumberLength(value, startIndex, false); 38if ((numberLength == 0) || (numberLength > HttpRuleParser.MaxInt64Digits))
System\Net\Http\Headers\KnownHeader.cs (2)
15Debug.Assert(name[0] == ':' || HttpRuleParser.IsToken(name)); 21Debug.Assert(name[0] == ':' || HttpRuleParser.IsToken(name));
System\Net\Http\Headers\MediaTypeHeaderValue.cs (5)
197current += HttpRuleParser.GetWhitespaceLength(input, current); 234int typeLength = HttpRuleParser.GetTokenLength(input, startIndex); 242current += HttpRuleParser.GetWhitespaceLength(input, current); 250current += HttpRuleParser.GetWhitespaceLength(input, current); 253int subtypeLength = HttpRuleParser.GetTokenLength(input, current);
System\Net\Http\Headers\NameValueHeaderValue.cs (12)
222int nameLength = HttpRuleParser.GetTokenLength(input, startIndex); 231current += HttpRuleParser.GetWhitespaceLength(input, current); 239current += HttpRuleParser.GetWhitespaceLength(input, current); // skip whitespace 244current += HttpRuleParser.GetWhitespaceLength(input, current); 259current += HttpRuleParser.GetWhitespaceLength(input, current); // skip whitespace 276int current = startIndex + HttpRuleParser.GetWhitespaceLength(input, startIndex); 290current += HttpRuleParser.GetWhitespaceLength(input, current); 300current += HttpRuleParser.GetWhitespaceLength(input, current); 332int valueLength = HttpRuleParser.GetTokenLength(input, startIndex); 337if (HttpRuleParser.GetQuotedStringLength(input, startIndex, out valueLength) != HttpParseResult.Parsed) 368HttpParseResult parseResult = HttpRuleParser.GetQuotedStringLength(value, 0, out int valueLength); 374else if (HttpRuleParser.ContainsNewLine(value))
System\Net\Http\Headers\NameValueWithParametersHeaderValue.cs (1)
117current += HttpRuleParser.GetWhitespaceLength(input, current);
System\Net\Http\Headers\ProductHeaderValue.cs (5)
116int nameLength = HttpRuleParser.GetTokenLength(input, startIndex); 125current += HttpRuleParser.GetWhitespaceLength(input, current); 134current += HttpRuleParser.GetWhitespaceLength(input, current); 137int versionLength = HttpRuleParser.GetTokenLength(input, current); 147current += HttpRuleParser.GetWhitespaceLength(input, current);
System\Net\Http\Headers\ProductInfoHeaderParser.cs (1)
34int current = index + HttpRuleParser.GetWhitespaceLength(value, index);
System\Net\Http\Headers\ProductInfoHeaderValue.cs (2)
134if (HttpRuleParser.GetCommentLength(input, current, out commentLength) != HttpParseResult.Parsed) 142current += HttpRuleParser.GetWhitespaceLength(input, current);
System\Net\Http\Headers\RangeHeaderValue.cs (3)
143int unitLength = HttpRuleParser.GetTokenLength(input, startIndex); 153current += HttpRuleParser.GetWhitespaceLength(input, current); 161current += HttpRuleParser.GetWhitespaceLength(input, current);
System\Net\Http\Headers\RangeItemHeaderValue.cs (7)
145int fromLength = HttpRuleParser.GetNumberLength(input, current, false); 147if (fromLength > HttpRuleParser.MaxInt64Digits) 153current += HttpRuleParser.GetWhitespaceLength(input, current); 163current += HttpRuleParser.GetWhitespaceLength(input, current); 171toLength = HttpRuleParser.GetNumberLength(input, current, false); 173if (toLength > HttpRuleParser.MaxInt64Digits) 179current += HttpRuleParser.GetWhitespaceLength(input, current);
System\Net\Http\Headers\RetryConditionHeaderValue.cs (3)
101int deltaLength = HttpRuleParser.GetNumberLength(input, current, false); 104if ((deltaLength == 0) || (deltaLength > HttpRuleParser.MaxInt32Digits)) 110current += HttpRuleParser.GetWhitespaceLength(input, current);
System\Net\Http\Headers\StringWithQualityHeaderValue.cs (7)
97int valueLength = HttpRuleParser.GetTokenLength(input, startIndex); 106current += HttpRuleParser.GetWhitespaceLength(input, current); 115current += HttpRuleParser.GetWhitespaceLength(input, current); 139current += HttpRuleParser.GetWhitespaceLength(input, current); 148current += HttpRuleParser.GetWhitespaceLength(input, current); 155int qualityLength = HttpRuleParser.GetNumberLength(input, current, true); 174current += HttpRuleParser.GetWhitespaceLength(input, current);
System\Net\Http\Headers\TimeSpanHeaderParser.cs (2)
30int numberLength = HttpRuleParser.GetNumberLength(value, startIndex, false); 32if ((numberLength == 0) || (numberLength > HttpRuleParser.MaxInt32Digits))
System\Net\Http\Headers\TransferCodingHeaderValue.cs (2)
74int valueLength = HttpRuleParser.GetTokenLength(input, startIndex); 83current += HttpRuleParser.GetWhitespaceLength(input, current);
System\Net\Http\Headers\ViaHeaderValue.cs (10)
160int receivedByLength = HttpRuleParser.GetHostLength(input, current, true); 169current += HttpRuleParser.GetWhitespaceLength(input, current); 175if (HttpRuleParser.GetCommentLength(input, current, out int commentLength) != HttpParseResult.Parsed) 183current += HttpRuleParser.GetWhitespaceLength(input, current); 201int protocolVersionOrNameLength = HttpRuleParser.GetTokenLength(input, current); 209int whitespaceLength = HttpRuleParser.GetWhitespaceLength(input, current); 223current += HttpRuleParser.GetWhitespaceLength(input, current); 225protocolVersionOrNameLength = HttpRuleParser.GetTokenLength(input, current); 235whitespaceLength = HttpRuleParser.GetWhitespaceLength(input, current); 262if (HttpRuleParser.GetHostLength(receivedBy, 0, true) != receivedBy.Length)
System\Net\Http\Headers\WarningHeaderValue.cs (8)
162if (HttpRuleParser.GetQuotedStringLength(input, current, out int textLength) != HttpParseResult.Parsed) 186int agentLength = HttpRuleParser.GetHostLength(input, current, true); 195int whitespaceLength = HttpRuleParser.GetWhitespaceLength(input, current); 210int codeLength = HttpRuleParser.GetNumberLength(input, current, false); 227int whitespaceLength = HttpRuleParser.GetWhitespaceLength(input, current); 244int whitespaceLength = HttpRuleParser.GetWhitespaceLength(input, current); 274current += HttpRuleParser.GetWhitespaceLength(input, current); 297if (HttpRuleParser.GetHostLength(agent, 0, true) != agent.Length)
System\Net\Http\HttpMethod.cs (1)
32if (!HttpRuleParser.IsToken(method))
System\Net\Http\HttpResponseMessage.cs (1)
93if ((value != null) && HttpRuleParser.ContainsNewLine(value))
System\Net\Http\MultipartContent.cs (5)
319Encoding headerValueEncoding = HeaderEncodingSelector?.Invoke(headerPair.Key, content) ?? HttpRuleParser.DefaultHttpEncoding; 339byte[] buffer = HttpRuleParser.DefaultHttpEncoding.GetBytes(input); 345return new MemoryStream(HttpRuleParser.DefaultHttpEncoding.GetBytes(input), writable: false); 376Encoding headerValueEncoding = HeaderEncodingSelector?.Invoke(headerPair.Key, content) ?? HttpRuleParser.DefaultHttpEncoding; 640WriteToStream(stream, content, HttpRuleParser.DefaultHttpEncoding);
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (1)
1115response.ReasonPhrase = HttpRuleParser.DefaultHttpEncoding.GetString(reasonBytes);