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

SentryOptions should use 'HttpMessageHandler' instead of 'HttpClientHandler' to support NSUrlSessionHandler on iOS #2502

Closed
AlexSchuetz opened this issue Jul 21, 2023 · 3 comments
Labels
Feature New feature or request

Comments

@AlexSchuetz
Copy link
Contributor

Problem Statement

The SentryOptions should accept the more general HttpMessageHandler instead of HttpClientHandler to provide to ability to use a custom-configured handler for the HttpClient.

Background:
It is recommended to use NSUrlSessionHandler on iOS (TLS 1.2, performance), but NSUrlSessionHandler only implements HttpMessageHandler.

Since NSUrlSessionHandler inherits from HttpMessageHandler and DefaultSentryHttpClientFactory also mainly uses this class to create the HttpClient, changes are going to be minor.

During creation of the HttpClient the DefaultSentryHttpClientFactory can take care of if it is a HttpClientHandler, a HttpMessageHandler or a NSUrlSessionHandler (which also accepts proxy and decompression properties.

Solution Brainstorm

Going to file a PR.

@AlexSchuetz
Copy link
Contributor Author

See PR 2503

@bruno-garcia
Copy link
Member

Fix merged, we'll close once release is made

@bitsandfoxes
Copy link
Contributor

bitsandfoxes commented Aug 11, 2023

Released with 3.35.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature or request
Projects
Archived in project
Development

No branches or pull requests

3 participants