Skip to content

Fallback RequestPath for when IHttpRequestFeature.RawTarteg is empty #191

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

Merged
merged 2 commits into from
May 1, 2020

Conversation

rsantosdev
Copy link
Contributor

When running integration tests using the WebApplicationFactory class, I noticed that the code httpContext.Features.Get<IHttpRequestFeature>()?.RawTarget returns an empty string instead of null, which causes the fallback never executing and displaying no path information.

@nblumhardt
Copy link
Member

Thanks! Since it's a bit of an odd non-mainline scenario (I can't help feeling that the test harness is broken, here), perhaps we go for the even more tactical string.IsNullOrEmpty() and add a comment explaining the involvement of WebApplicationFactory?

@rsantosdev
Copy link
Contributor Author

@nblumhardt thanks for the feedback. I added request adjustments

@nblumhardt nblumhardt merged commit acd7024 into serilog:dev May 1, 2020
@nblumhardt
Copy link
Member

Thanks! 👍

@nblumhardt nblumhardt mentioned this pull request Jul 24, 2020
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

Successfully merging this pull request may close these issues.

2 participants