File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
apollo-router/src/axum_factory Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -478,9 +478,10 @@ async fn handle_graphql(
478
478
let body = match opt_compressor {
479
479
None => body,
480
480
Some ( compressor) => {
481
- parts
482
- . headers
483
- . insert ( CONTENT_ENCODING , HeaderValue :: from_static ( "deflate" ) ) ;
481
+ parts. headers . insert (
482
+ CONTENT_ENCODING ,
483
+ HeaderValue :: from_static ( compressor. content_encoding ( ) ) ,
484
+ ) ;
484
485
Body :: wrap_stream ( compressor. process ( body) )
485
486
}
486
487
} ;
Original file line number Diff line number Diff line change @@ -55,6 +55,15 @@ impl Compressor {
55
55
None
56
56
}
57
57
58
+ pub ( crate ) fn content_encoding ( & self ) -> & ' static str {
59
+ match self {
60
+ Compressor :: Deflate ( _) => "deflate" ,
61
+ Compressor :: Gzip ( _) => "gzip" ,
62
+ Compressor :: Brotli ( _) => "br" ,
63
+ Compressor :: Zstd ( _) => "zstd" ,
64
+ }
65
+ }
66
+
58
67
pub ( crate ) fn process (
59
68
mut self ,
60
69
mut stream : hyper:: Body ,
You can’t perform that action at this time.
0 commit comments