diff --git a/test/Kestrel.FunctionalTests/BadHttpRequestTests.cs b/test/Kestrel.FunctionalTests/BadHttpRequestTests.cs index 923f0fdccc..af8e3916c3 100644 --- a/test/Kestrel.FunctionalTests/BadHttpRequestTests.cs +++ b/test/Kestrel.FunctionalTests/BadHttpRequestTests.cs @@ -169,6 +169,22 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests Assert.Equal(LogLevel.Information, maxLogLevel); } + [Fact] + public async Task TestRequestSplitting() + { + using (var server = new TestServer(context => Task.CompletedTask, new TestServiceContext { Log = Mock.Of() })) + { + using (var client = server.CreateConnection()) + { + await client.SendAll( + "GET /\x0D\0x0ALocation:http://www.contoso.com/ HTTP/1.1", + "Host:\r\n\r\n"); + + await client.ReceiveStartsWith("HTTP/1.1 400"); + } + } + } + private async Task TestBadRequest(string request, string expectedResponseStatusCode, string expectedExceptionMessage, string expectedAllowHeader = null) { BadHttpRequestException loggedException = null; diff --git a/test/shared/HttpParsingData.cs b/test/shared/HttpParsingData.cs index c25771cd48..94ac2c8e39 100644 --- a/test/shared/HttpParsingData.cs +++ b/test/shared/HttpParsingData.cs @@ -219,6 +219,7 @@ namespace Microsoft.AspNetCore.Testing "}", "get@", "post=", + "[0x00]" }.Concat(MethodWithNullCharData); } } @@ -435,6 +436,7 @@ namespace Microsoft.AspNetCore.Testing { "OPTIONS *", "" }, { "GET /pub/WWW/", "" }, { "GET /pub/WWW/", " " }, + { "GET /pub/WWW/", "." }, { "GET /pub/WWW/", "www.example.org" }, { "GET http://localhost/", "localhost" }, { "GET http://localhost:80/", "localhost:80" },