File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -200,6 +200,16 @@ impl ApolloTracing {
200200 }
201201 } ;
202202
203+ let mut client = client
204+ . post ( REPORTING_URL )
205+ . header ( "content-type" , "application/protobuf" )
206+ . header ( "accept" , "application/json" )
207+ . header ( "X-Api-Key" , & authorization_token) ;
208+
209+ if cfg ! ( feature = "compression" ) {
210+ client = client. header ( "content-encoding" , "gzip" ) ;
211+ } ;
212+
203213 let msg = match compression:: compress ( msg) {
204214 Ok ( result) => result,
205215 Err ( e) => {
@@ -208,15 +218,7 @@ impl ApolloTracing {
208218 }
209219 } ;
210220
211- let result = client
212- . post ( REPORTING_URL )
213- . body ( msg)
214- . header ( "content-type" , "application/protobuf" )
215- . header ( "content-encoding" , "gzip" )
216- . header ( "accept" , "application/json" )
217- . header ( "X-Api-Key" , & authorization_token)
218- . send ( )
219- . await ;
221+ let result = client. body ( msg) . send ( ) . await ;
220222
221223 match result {
222224 Ok ( data) => {
You can’t perform that action at this time.
0 commit comments