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 {
200
200
}
201
201
} ;
202
202
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
+
203
213
let msg = match compression:: compress ( msg) {
204
214
Ok ( result) => result,
205
215
Err ( e) => {
@@ -208,15 +218,7 @@ impl ApolloTracing {
208
218
}
209
219
} ;
210
220
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 ;
220
222
221
223
match result {
222
224
Ok ( data) => {
You can’t perform that action at this time.
0 commit comments