Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Commit 97acb95

Browse files
author
John Luo
committed
Set default protocol to HTTP/1.x
1 parent 194b18b commit 97acb95

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/Kestrel.Core/ListenOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ public FileHandleType HandleType
126126
/// <summary>
127127
/// The protocols enabled on this endpoint.
128128
/// </summary>
129-
/// <remarks>Defaults to HTTP/1.x and HTTP/2.</remarks>
130-
public HttpProtocols Protocols { get; set; } = HttpProtocols.Http1AndHttp2;
129+
/// <remarks>Defaults to HTTP/1.x.</remarks>
130+
public HttpProtocols Protocols { get; set; } = HttpProtocols.Http1;
131131

132132
/// <summary>
133133
/// Gets the <see cref="List{IConnectionAdapter}"/> that allows each connection <see cref="System.IO.Stream"/>

test/Kestrel.Core.Tests/ListenOptionsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class ListenOptionsTests
1515
public void ProtocolsDefault()
1616
{
1717
var listenOptions = new ListenOptions(new IPEndPoint(IPAddress.Loopback, 0));
18-
Assert.Equal(HttpProtocols.Http1AndHttp2, listenOptions.Protocols);
18+
Assert.Equal(HttpProtocols.Http1, listenOptions.Protocols);
1919
}
2020

2121
[Fact]

test/Kestrel.Tests/KestrelConfigurationBuilderTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ public void EndpointConfigSectionCanSetProtocols(string input, HttpProtocols exp
385385
serverOptions.ConfigureEndpointDefaults(opt =>
386386
{
387387
// Kestrel default.
388-
Assert.Equal(HttpProtocols.Http1AndHttp2, opt.Protocols);
388+
Assert.Equal(HttpProtocols.Http1, opt.Protocols);
389389
ranDefault = true;
390390
});
391391

@@ -415,14 +415,14 @@ public void EndpointConfigSectionCanSetProtocols(string input, HttpProtocols exp
415415
.LocalhostEndpoint(5002, opt =>
416416
{
417417
// Kestrel default.
418-
Assert.Equal(HttpProtocols.Http1AndHttp2, opt.Protocols);
418+
Assert.Equal(HttpProtocols.Http1, opt.Protocols);
419419
ran2 = true;
420420
})
421421
.Load();
422422
serverOptions.ListenAnyIP(0, opt =>
423423
{
424424
// Kestrel default.
425-
Assert.Equal(HttpProtocols.Http1AndHttp2, opt.Protocols);
425+
Assert.Equal(HttpProtocols.Http1, opt.Protocols);
426426
ran3 = true;
427427
});
428428

0 commit comments

Comments
 (0)