Closed jlocans closed 3 years ago
Add services.AddHttpContextAccessor()
and you will be able to access the original HttpContext.
Thank you @alexeymarkov !
I'll add what is maybe obvious, but you also need to inject IHttpContextAccessor
instead of IContextProvider
First - I think that this is a really great project. Thanks and respect to James. Sadly, learner about the uncertain future of the project.
Nevertheless, I want to ask for a change, hoping that project continues to live on.
So, I don't really understand why
HttpContext
inIContextProvider
has been stripped down, leaving onlyClaimsPrincipal
,Headers
andRequestUrl
. Why not expose the whole object? This has caused an issue to which I don't see any workaround. I need to access client's IP address which is found inHttpContext.Connection.RemoteIpAddress
. Unfortunately this is not available in Function Monkey. This is just one example, I'm sure there are many more cases where one would need to access whole request context object.