U \M@sfddlmZddlmZzddlmZWn ek rHddlmZYnXGdddeZddZ dS) )Hub) Integration)HTTPConnectionc@seZdZdZeddZdS)StdlibIntegrationstdlibcCs tdS)N)install_httplibrrO/opt/alt/python38/lib/python3.8/site-packages/sentry_sdk/integrations/stdlib.py setup_onceszStdlibIntegration.setup_onceN)__name__ __module__ __qualname__ identifier staticmethodr rrrr r srcs4tjtjfdd}fdd}|t_|t_dS)Nc s|||f||}tjtdkr(|Si|_}|j}|j}|j} |} | ds~d| dkr`dpbd||| krtd|pvd|f} | |d<||d <|S) N)zhttp://zhttps://z %s://%s%s%sihttpshttpz:%surlmethod) rcurrentget_integrationr_sentrysdk_data_dicthostport default_port startswith) selfrrargskwargsrvdatarrrZreal_url)real_putrequestrr putrequests$  z#install_httplib..putrequestcsn|f||}tj}|tdkr(|St|ddp6i}d|krT|j|d<|j|d<|jdd|d|id|S)NrZ status_codereasonrhttplibZhttplib_response)typecategoryr Zhint)rrrrgetattrstatusr#Zadd_breadcrumb)rrrrZhubr )real_getresponserr getresponse1s  z$install_httplib..getresponse)rr"r*)r"r*r)r)r!r rs   rN) Zsentry_sdk.hubrZsentry_sdk.integrationsrr$r ImportErrorZ http.clientrrrrrr s