Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose httpContextAccessor in options #47

Closed
namnik opened this issue Feb 18, 2019 · 2 comments
Closed

expose httpContextAccessor in options #47

namnik opened this issue Feb 18, 2019 · 2 comments

Comments

@namnik
Copy link

namnik commented Feb 18, 2019

Hi dear;
I want to pass the path of current request to Instance property of Problem Details.
for example:

services.AddProblemDetails(options =>
{
options.Map(ex => new ProblemDetails()
{
Title = ex.Code.ToString(),
Detail = ex.Message,
Status = (int?)ex.HttpStatusCode,
Instance= httpContextAccessor.HttpContext.Request.Path
}));

Can I access to httpContextAccessor?

@khellang
Copy link
Owner

This seems like a duplicate of #46. I'll try to get this fixed today.

@namnik
Copy link
Author

namnik commented Feb 18, 2019

Thanks for your contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants