Tricked by WebRequest
Read OriginalThe article details a bug encountered in the Datadog .NET tracer when switching from HttpClient to HttpWebRequest. A customer's custom WebRequest factory caused an InvalidCastException. The author explains the root cause—global WebRequest prefix overrides—and reveals the solution: using WebRequest.CreateHttp to guarantee an HttpWebRequest instance, along with challenges in writing unit tests for this scenario.
Comments
No comments yet
Be the first to share your thoughts!
Browser Extension
Get instant access to AllDevBlogs from your browser