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

ThreeMammals / Ocelot / 26761608736

01 Jun 2026 02:34PM UTC coverage: 0.0% (-95.4%) from 95.403%
26761608736

Pull #2394

github

web-flow
Merge e39fc0db2 into e4022a7d8
Pull Request #2394: Harden `FileConfigurationPoller` against timer reentrancy and callback thread leaks, and stabilize `TimeoutDelegatingHandler` timeout test

0 of 7112 relevant lines covered (0.0%)

0.0 hits per line

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

0.0
src/Ocelot/Infrastructure/RequestData/HttpDataRepository.cs
1
using Microsoft.AspNetCore.Http;
2
using Ocelot.Responses;
3

4
namespace Ocelot.Infrastructure.RequestData;
5

6
public class HttpDataRepository : IRequestScopedDataRepository
7
{
8
    private readonly IHttpContextAccessor _contextAccessor;
9

10
    public HttpDataRepository(IHttpContextAccessor contextAccessor)
×
11
    {
×
12
        ArgumentNullException.ThrowIfNull(contextAccessor);
×
13
        _contextAccessor = contextAccessor;
×
14
    }
×
15

16
    public Response Add<T>(string key, T value)
17
    {
×
18
        try
19
        {
×
20
            _contextAccessor.HttpContext.Items.Add(key, value);
×
21
            return new OkResponse();
×
22
        }
23
        catch (Exception exception)
×
24
        {
×
25
            return new ErrorResponse(new CannotAddDataError(exception));
×
26
        }
27
    }
×
28

29
    public Response Update<T>(string key, T value)
30
    {
×
31
        try
32
        {
×
33
            _contextAccessor.HttpContext.Items[key] = value;
×
34
            return new OkResponse();
×
35
        }
36
        catch (Exception exception)
×
37
        {
×
38
            return new ErrorResponse(new CannotAddDataError(exception));
×
39
        }
40
    }
×
41

42
    public Response<T> Get<T>(string key)
43
    {
×
44
        if (_contextAccessor.HttpContext?.Items == null)
×
45
        {
×
46
            return new ErrorResponse<T>(new CannotFindDataError($"Unable to find data for key: {key} because HttpContext or HttpContext.Items is null"));
×
47
        }
48

49
        return _contextAccessor.HttpContext.Items.TryGetValue(key, out var item)
×
50
            ? new OkResponse<T>((T)item)
×
51
            : new ErrorResponse<T>(new CannotFindDataError($"Unable to find data for key: {key}"));
×
52
    }
×
53
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc