[InlineData("nocolon")]
[InlineData("no colon")]
[InlineData("Content-Length ")]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/54160", TestPlatforms.Browser)]
+ [SkipOnPlatform(TestPlatforms.Browser, "Browser is relaxed about validating HTTP headers")]
public async Task GetAsync_InvalidHeaderNameValue_ThrowsHttpRequestException(string invalidHeader)
{
if (UseVersion == HttpVersion30)
[InlineData(true, false)]
[InlineData(false, true)]
[InlineData(true, true)]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/54160", TestPlatforms.Browser)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/86317", typeof(PlatformDetection), nameof(PlatformDetection.IsNodeJS))]
public async Task GetAsync_IncompleteData_ThrowsHttpRequestException(bool failDuringHeaders, bool getString)
{
if (IsWinHttpHandler)
return;
}
+ if (PlatformDetection.IsBrowser && failDuringHeaders)
+ {
+ return; // chrome browser doesn't validate this
+ }
+
await LoopbackServer.CreateClientAndServerAsync(async uri =>
{
using (HttpClient client = CreateHttpClient())
}
[Fact]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/54160", TestPlatforms.Browser)]
+ [SkipOnPlatform(TestPlatforms.Browser, "TypeError: Failed to fetch on a Browser")]
public async Task GetAsync_NonTraditionalChunkSizes_Accepted()
{
if (LoopbackServerFactory.Version >= HttpVersion20.Value)
[InlineData("xyz")] // non-hex
[InlineData("7gibberish")] // valid size then gibberish
[InlineData("7\v\f")] // unacceptable whitespace
- [ActiveIssue("https://github.com/dotnet/runtime/issues/54160", TestPlatforms.Browser)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/86317", typeof(PlatformDetection), nameof(PlatformDetection.IsNodeJS))]
public async Task GetAsync_InvalidChunkSize_ThrowsHttpRequestException(string chunkSize)
{
if (UseVersion != HttpVersion.Version11)
}
[Fact]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/54160", TestPlatforms.Browser)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/86317", typeof(PlatformDetection), nameof(PlatformDetection.IsNodeJS))]
public async Task GetAsync_InvalidChunkTerminator_ThrowsHttpRequestException()
{
if (UseVersion != HttpVersion.Version11)
}
[Fact]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/54160", TestPlatforms.Browser)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/86317", typeof(PlatformDetection), nameof(PlatformDetection.IsNodeJS))]
public async Task GetAsync_InfiniteChunkSize_ThrowsHttpRequestException()
{
if (UseVersion != HttpVersion.Version11)
[Theory]
[InlineData(99)]
[InlineData(1000)]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/54160", TestPlatforms.Browser)]
+ [SkipOnPlatform(TestPlatforms.Browser, "Browser is relaxed about validating HTTP headers")]
public async Task GetAsync_StatusCodeOutOfRange_ExpectedException(int statusCode)
{
if (UseVersion == HttpVersion30)
}
[Fact]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/54160", TestPlatforms.Browser)]
+ [SkipOnPlatform(TestPlatforms.Browser, "ExpectContinue not supported on Browser")]
public async Task SendAsync_Expect100Continue_RequestBodyFails_ThrowsContentException()
{
if (IsWinHttpHandler)
[Theory]
[InlineData(false)]
[InlineData(true)]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/54160", TestPlatforms.Browser)]
public async Task PostAsync_ThrowFromContentCopy_RequestFails(bool syncFailure)
{
if (UseVersion == HttpVersion30)
[InlineData(TransferType.ContentLength, TransferError.ContentLengthTooLarge)]
[InlineData(TransferType.Chunked, TransferError.MissingChunkTerminator)]
[InlineData(TransferType.Chunked, TransferError.ChunkSizeTooLarge)]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/54160", TestPlatforms.Browser)]
public async Task ReadAsStreamAsync_InvalidServerResponse_ThrowsIOException(
TransferType transferType,
TransferError transferError)
{
await StartTransferTypeAndErrorServer(transferType, transferError, async uri =>
{
- if (IsWinHttpHandler)
+ if (PlatformDetection.IsBrowser) // TypeError: Failed to fetch
+ {
+ await Assert.ThrowsAsync<HttpRequestException>(() => ReadAsStreamHelper(uri));
+ }
+ else if (IsWinHttpHandler)
{
await Assert.ThrowsAsync<IOException>(() => ReadAsStreamHelper(uri));
}