Skip to content

ref: Make HTTP transport extensible#235

Merged
untitaker merged 1 commit into
masterfrom
ref/transport-http-subclassable
Jan 11, 2019
Merged

ref: Make HTTP transport extensible#235
untitaker merged 1 commit into
masterfrom
ref/transport-http-subclassable

Conversation

@untitaker

Copy link
Copy Markdown
Member

Use like this:

from sentry_sdk.transport import HTTPTransport

class CustomHTTPTransport(HTTPTransport):
    def _get_pool_options(self, *args, **kwargs):
        options = HTTPTransport._get_pool_options(self, *args, **kwargs)
        options['cert_file'] = '...'

sentry_sdk.init(..., transport=CustomHTTPTransport)

This allows you to overwrite the entire urllib3 connection pool if you feel like it.

@codecov-io

codecov-io commented Jan 11, 2019

Copy link
Copy Markdown

Codecov Report

Merging #235 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #235      +/-   ##
==========================================
+ Coverage   81.26%   81.27%   +0.01%     
==========================================
  Files          32       32              
  Lines        2674     2676       +2     
  Branches      430      430              
==========================================
+ Hits         2173     2175       +2     
  Misses        338      338              
  Partials      163      163
Impacted Files Coverage Δ
sentry_sdk/transport.py 80.9% <100%> (+0.35%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 93bab13...e7ff072. Read the comment docs.

@untitaker
untitaker merged commit f0c8edb into master Jan 11, 2019
@untitaker
untitaker deleted the ref/transport-http-subclassable branch January 11, 2019 15:33
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