< Summary - Kestrun — Combined Coverage

Information
Class: Kestrun.Hosting.Options.ListenerOptions
Assembly: Kestrun
File(s): /home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Hosting/Options/ListenerOptions.cs
Tag: Kestrun/Kestrun@9d3a582b2d63930269564a7591aa77ef297cadeb
Line coverage
100%
Covered lines: 13
Uncovered lines: 0
Coverable lines: 13
Total lines: 54
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_IPAddress()100%11100%
get_Port()100%11100%
get_UseHttps()100%11100%
get_Protocols()100%11100%
get_UseConnectionLogging()100%11100%
get_X509Certificate()100%11100%
get_DisableAltSvcHeader()100%11100%
.ctor()100%11100%

File(s)

/home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Hosting/Options/ListenerOptions.cs

#LineLine coverage
 1using System.Net;
 2using System.Security.Cryptography.X509Certificates;
 3using Microsoft.AspNetCore.Server.Kestrel.Core;
 4
 5namespace Kestrun.Hosting.Options;
 6
 7/// <summary>
 8/// Configuration for an individual Kestrel listener.
 9/// </summary>
 10public class ListenerOptions
 11{
 12    /// <summary>The IP address to bind to.</summary>
 4213    public IPAddress IPAddress { get; set; }
 14
 15    /// <summary>The port to listen on.</summary>
 2716    public int Port { get; set; }
 17
 18    /// <summary>Whether HTTPS should be used.</summary>
 3919    public bool UseHttps { get; set; }
 20
 21    /// <summary>HTTP protocols supported by the listener.</summary>
 4222    public HttpProtocols Protocols { get; set; }
 23
 24    /// <summary>Enable verbose connection logging.</summary>
 3925    public bool UseConnectionLogging { get; set; }
 26
 27    /// <summary>Optional TLS certificate.</summary>
 1628    public X509Certificate2? X509Certificate { get; internal set; }
 29
 30    /// <summary>
 31    /// Gets or sets a value that controls whether the "Alt-Svc" header is included with response headers.
 32    /// The "Alt-Svc" header is used by clients to upgrade HTTP/1.1 and HTTP/2 connections to HTTP/3.
 33    /// <para>
 34    /// The "Alt-Svc" header is automatically included with a response if <see cref="Protocols"/> has either
 35    /// HTTP/1.1 or HTTP/2 enabled, and HTTP/3 is enabled. If an "Alt-Svc" header value has already been set
 36    /// by the app then it isn't changed.
 37    /// </para>
 38    /// </summary>
 39    /// <remarks>
 40    /// Defaults to false.
 41    /// </remarks>
 842    public bool DisableAltSvcHeader { get; set; }
 43
 44    /// <summary>
 45    /// Initializes a new instance of the <see cref="ListenerOptions"/> class with default values.
 46    /// </summary>
 1547    public ListenerOptions()
 48    {
 1549        IPAddress = IPAddress.Any;
 1550        UseHttps = false;
 1551        Protocols = HttpProtocols.Http1;
 1552        UseConnectionLogging = false;
 1553    }
 54}