Merge pull request #4403 from Bond-009/http2

Http1AndHttp2 is the default, no need to explicitly enable it
This commit is contained in:
Anthony Lavado 2020-11-02 11:10:28 -05:00 committed by GitHub
commit f23836c6a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -290,23 +290,19 @@ namespace Jellyfin.Server
{
_logger.LogInformation("Kestrel listening on {IpAddress}", address);
options.Listen(address, appHost.HttpPort);
if (appHost.ListenWithHttps)
{
options.Listen(address, appHost.HttpsPort, listenOptions =>
{
listenOptions.UseHttps(appHost.Certificate);
listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
});
options.Listen(
address,
appHost.HttpsPort,
listenOptions => listenOptions.UseHttps(appHost.Certificate));
}
else if (builderContext.HostingEnvironment.IsDevelopment())
{
try
{
options.Listen(address, appHost.HttpsPort, listenOptions =>
{
listenOptions.UseHttps();
listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
});
options.Listen(address, appHost.HttpsPort, listenOptions => listenOptions.UseHttps());
}
catch (InvalidOperationException ex)
{
@ -322,21 +318,15 @@ namespace Jellyfin.Server
if (appHost.ListenWithHttps)
{
options.ListenAnyIP(appHost.HttpsPort, listenOptions =>
{
listenOptions.UseHttps(appHost.Certificate);
listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
});
options.ListenAnyIP(
appHost.HttpsPort,
listenOptions => listenOptions.UseHttps(appHost.Certificate));
}
else if (builderContext.HostingEnvironment.IsDevelopment())
{
try
{
options.ListenAnyIP(appHost.HttpsPort, listenOptions =>
{
listenOptions.UseHttps();
listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
});
options.ListenAnyIP(appHost.HttpsPort, listenOptions => listenOptions.UseHttps());
}
catch (InvalidOperationException ex)
{