[AspNet] Use Http*Base classes in public API - #3110
Conversation
80148cd to
a07569f
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3110 +/- ##
==========================================
- Coverage 70.20% 69.76% -0.44%
==========================================
Files 429 410 -19
Lines 16820 16235 -585
==========================================
- Hits 11808 11327 -481
+ Misses 5012 4908 -104
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
a07569f to
4249f04
Compare
|
@qhris, it will be great if you can check this PR. You have requested these changes long time ago. |
alanwest
left a comment
There was a problem hiding this comment.
Seems a little odd to make this change solely for the purpose of testability. I'm approving, but there's a fair amount of history here I'm not familiar with, so I do not fully understand the reasons why we should make this change.
rajkumar-rangaraj
left a comment
There was a problem hiding this comment.
I acknowledge Alan's point. I see that we've made it testable. Do you know what benefits or drawbacks this change might bring?
|
I'm not in a situation to check this out in much detail at the moment, but it looks good to me. From what I can remember, setting Last time I looked into this, I found it very hard to actually test functionality without having to spin up a local server each time which led to very slow development and testing. But it has been almost 2 years since I made the issue and my memory is a bit fuzzy at this point. 😄 @alanwest |
|
The main drawback I see is Based on additional research, the As Base classes are modern, I would go with this implementation. |
Fixes #1438
Changes
All usages of
HttpRequest,HttpResponseandHttpContextreplaced byHttpRequestBase,HttpResponseBaseandHttpContextBaserespectively.Added simple test to utilize new (internal) API.
The only drawback I see is
src/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule/TelemetryHttpModule.cswhere there is couple of calls of (new HttpContextWrapper(realContextHere).It is the last moment where we can consider such breaking change without rising major version.
Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changes