• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ThreeMammals / Ocelot / 33166330209

28 Aug 2026 11:12AM UTC coverage: 97.07% (-0.6%) from 97.638%
33166330209

push

github

raman-m
Don't upload code coverage for Release-mode DLLs as a second uploaded report, since it breaks the coverage process for Debug DLLs

6725 of 6928 relevant lines covered (97.07%)

1958.57 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.0
src/QueryStrings/ClaimsToQueryStringMiddleware.cs
1
using Microsoft.AspNetCore.Http;
2
using Ocelot.Logging;
3
using Ocelot.Middleware;
4

5
namespace Ocelot.QueryStrings;
6

7
public class ClaimsToQueryStringMiddleware : OcelotMiddleware
8
{
9
    private readonly RequestDelegate _next;
10
    private readonly IAddQueriesToRequest _addQueriesToRequest;
11

12
    public ClaimsToQueryStringMiddleware(RequestDelegate next,
13
        IOcelotLoggerFactory loggerFactory,
14
        IAddQueriesToRequest addQueriesToRequest)
15
            : base(loggerFactory.CreateLogger<ClaimsToQueryStringMiddleware>())
7✔
16
    {
7✔
17
        _next = next;
7✔
18
        _addQueriesToRequest = addQueriesToRequest;
7✔
19
    }
7✔
20

21
    public async Task Invoke(HttpContext httpContext)
22
    {
1✔
23
        var downstreamRoute = httpContext.Items.DownstreamRoute();
1✔
24

25
        if (downstreamRoute.ClaimsToQueries.Any())
1✔
26
        {
1✔
27
            Logger.LogInformation(() => $"{downstreamRoute.DownstreamPathTemplate.Value} has instructions to convert claims to queries");
1✔
28

29
            var downstreamRequest = httpContext.Items.DownstreamRequest();
1✔
30

31
            var response = _addQueriesToRequest.SetQueriesOnDownstreamRequest(downstreamRoute.ClaimsToQueries, httpContext.User.Claims, downstreamRequest);
1✔
32

33
            if (response.IsError)
1✔
34
            {
×
35
                Logger.LogWarning("there was an error setting queries on context, setting pipeline error");
×
36

37
                httpContext.Items.UpsertErrors(response.Errors);
×
38
                return;
×
39
            }
40
        }
1✔
41

42
        await _next.Invoke(httpContext);
1✔
43
    }
1✔
44
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc