Search code examples
ocelot

DownstreamContext of context not found


I'm trying to add a custom middleware to add parameters to the query.

According to some online search, you can do something like this:

{
            //PreQueryStringBuilderMiddleware occurs after authorization
            PreQueryStringBuilderMiddleware = async (ctx, next) =>
            {
                var upstreamRoute = ctx.DownstreamReRoute.UpstreamPathTemplate;
                Log.Information($"{upstreamRoute}");
                await next.Invoke();
            }
        };

See this answer

But for me it says HttpContext doesn't contain a definition of DownstreamReRoute.
Is there something I am missing or has this been changed?


Solution

  • Alright, turned out this did actually change and in an earlier versions this still works. But it looks like Ocelot is dead anyway from what I read.