Skip to content

Conversation

yousif-bugsnag
Copy link
Contributor

Goal

Replace the obsolete HttpWebRequest based delivery with a new default implementation using HttpClient. This allows us to remove the dependency on System.Net.Requests (which has dependencies with known vulnerabilities).

Design

The old ThreadQueueDelivery class has been replaced with a new DefaultDelivery class that uses HttpClient to send requests to the configured endpoints.

The new implementation maintains the queue-based delivery mechanism, but with a few changes/improvements:

  • Replaces the hand-cranked BlockingQueue<IPayLoad> implementation with a BlockingCollection<IPayLoad> from .NET, which handles thread-safety internally.
  • Uses Task.Run instead of using a dedicated thread that runs continuously.
  • Uses a CancellationTokenSource for cleaner shutdown.

The HttpClient is configured to use the proxy from client configuration (if set) and the Proxy property has been removed from the IPayLoad interface - this means that setting/overriding the proxy for individual reports in a BeforeNotify call is no longer supported.

Testing

Added new unit tests and tested manually in a sample project

@yousif-bugsnag yousif-bugsnag changed the title Replace default deilvery with HttpClient implementation Replace default delivery with HttpClient implementation Mar 18, 2025
Co-authored-by: Jason <lemnik@users.noreply.github.com>
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