@@ -8,7 +8,6 @@ use hyper::{HeaderMap, Request, Uri};
88use regex:: Regex ;
99use serde_json:: Value ;
1010use std:: io:: prelude:: * ;
11- use std:: sync:: Arc ;
1211use std:: time:: Instant ;
1312use tracing:: { debug, warn} ;
1413
@@ -23,7 +22,7 @@ const INGEST_PATH_SEGMENTS: [&str; 3] = ["envelope", "store", "integration"];
2322/// to the outbound DSN. This function returns `RequestBuilder` because the body types
2423/// are tedious to deal with.
2524pub fn make_outbound_request (
26- config : & Arc < ConfigData > ,
25+ config : & ConfigData ,
2726 uri : & Uri ,
2827 headers : & HeaderMap ,
2928 outbound : & dsn:: Dsn ,
@@ -135,7 +134,7 @@ fn replace_public_key(target: &str, outbound: &dsn::Dsn) -> String {
135134}
136135
137136pub async fn read_and_decode_body < B : Body > (
138- config : & Arc < ConfigData > ,
137+ config : & ConfigData ,
139138 request : Request < B > ,
140139 headers : & HeaderMap ,
141140 public_key : & str ,
@@ -260,7 +259,7 @@ mod tests {
260259
261260 #[ test]
262261 fn make_outbound_request_remove_proxy_headers ( ) {
263- let config = Arc :: new ( ConfigData :: default ( ) ) ;
262+ let config = ConfigData :: default ( ) ;
264263 let outbound
: dsn
:: Dsn =
"https://[email protected] /6789" 265264 . parse ( )
266265 . unwrap ( ) ;
@@ -290,7 +289,7 @@ mod tests {
290289
291290 #[ test]
292291 fn make_outbound_request_replace_sentry_auth_header ( ) {
293- let config = Arc :: new ( ConfigData :: default ( ) ) ;
292+ let config = ConfigData :: default ( ) ;
294293 let outbound
: dsn
:: Dsn =
"https://[email protected] /6789" 295294 . parse ( )
296295 . unwrap ( ) ;
@@ -315,7 +314,7 @@ mod tests {
315314
316315 #[ test]
317316 fn make_outbound_request_replace_authorization_header ( ) {
318- let config = Arc :: new ( ConfigData :: default ( ) ) ;
317+ let config = ConfigData :: default ( ) ;
319318 let outbound
: dsn
:: Dsn =
"https://[email protected] /6789" 320319 . parse ( )
321320 . unwrap ( ) ;
@@ -346,7 +345,7 @@ mod tests {
346345
347346 #[ test]
348347 fn make_outbound_request_replace_query_key ( ) {
349- let config = Arc :: new ( ConfigData :: default ( ) ) ;
348+ let config = ConfigData :: default ( ) ;
350349 let outbound
: dsn
:: Dsn =
"https://[email protected] /6789" 351350 . parse ( )
352351 . unwrap ( ) ;
@@ -370,7 +369,7 @@ mod tests {
370369
371370 #[ test]
372371 fn make_outbound_request_replace_path_host_and_scheme ( ) {
373- let config = Arc :: new ( ConfigData :: default ( ) ) ;
372+ let config = ConfigData :: default ( ) ;
374373 let outbound
: dsn
:: Dsn =
"https://[email protected] /6789" 375374 . parse ( )
376375 . unwrap ( ) ;
@@ -397,7 +396,7 @@ mod tests {
397396
398397 #[ test]
399398 fn make_outbound_request_replace_project_id_oltp_url ( ) {
400- let config = Arc :: new ( ConfigData :: default ( ) ) ;
399+ let config = ConfigData :: default ( ) ;
401400 let outbound
: dsn
:: Dsn =
"https://[email protected] /6789" 402401 . parse ( )
403402 . unwrap ( ) ;
@@ -420,7 +419,7 @@ mod tests {
420419
421420 #[ test]
422421 fn make_outbound_request_content_encoding_header ( ) {
423- let config = Arc :: new ( ConfigData :: default ( ) ) ;
422+ let config = ConfigData :: default ( ) ;
424423 let outbound
: dsn
:: Dsn =
"https://[email protected] /6789" 425424 . parse ( )
426425 . unwrap ( ) ;
@@ -443,10 +442,10 @@ mod tests {
443442 "should be absent when envelope_header modification is on"
444443 ) ;
445444
446- let config = Arc :: new ( ConfigData {
445+ let config = ConfigData {
447446 modify_envelope_header : false ,
448447 ..ConfigData :: default ( )
449- } ) ;
448+ } ;
450449 let builder = make_outbound_request ( & config, & uri, & headers, & outbound) ;
451450 let res = builder. body ( "" ) ;
452451
@@ -639,7 +638,7 @@ mod tests {
639638
640639 #[ tokio:: test]
641640 async fn test_read_and_decode_body ( ) {
642- let config = Arc :: new ( make_test_config ( ) ) ;
641+ let config = make_test_config ( ) ;
643642 assert ! ( config. modify_envelope_header, "Should default to true" ) ;
644643
645644 let contents = b"some content to be compressed" ;
@@ -666,7 +665,6 @@ mod tests {
666665 async fn test_read_and_decode_body_decode_disabled ( ) {
667666 let mut config = make_test_config ( ) ;
668667 config. modify_envelope_header = false ;
669- let config = Arc :: new ( config) ;
670668
671669 let contents = b"some content to be compressed" ;
672670 let mut encoder = DeflateEncoder :: new ( & contents[ ..] , Compression :: fast ( ) ) ;
0 commit comments