< Summary

Information
Class: Syki.Back.Exceptions.CustomHeadersMiddleware
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Exceptions/CustomHeadersMiddleware.cs
Tag: 22_11348620282
Line coverage
100%
Covered lines: 10
Uncovered lines: 0
Coverable lines: 10
Total lines: 17
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

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
Invoke()100%11100%

File(s)

/home/runner/work/syki/syki/Back/Exceptions/CustomHeadersMiddleware.cs

#LineLine coverage
 1namespace Syki.Back.Exceptions;
 2
 13public class CustomHeadersMiddleware(RequestDelegate next, FeaturesSettings settings)
 4{
 5    public async Task Invoke(HttpContext context)
 6    {
 49577        context.Response.OnStarting(() =>
 49578        {
 49579            context.Response.Headers["X-Hash"] = Env.GetLastCommitHash();
 495710            context.Response.Headers["X-SkipUserRegister"] = settings.SkipUserRegister.ToString();
 495711            context.Response.Headers["X-CrossLogin"] = settings.CrossLogin.ToString();
 495712            return Task.CompletedTask;
 495713        });
 14
 495715        await next(context);
 495716    }
 17}