Rewild Your Web
web browser dweb
16
fork

Configure Feed

Select the types of activity you want to include in your feed.

vhost: enable zstd content encoding

webbeef 1f13a1d1 7f599511

+13 -7
+1
Cargo.lock
··· 9419 9419 source = "registry+https://github.com/rust-lang/crates.io-index" 9420 9420 checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" 9421 9421 dependencies = [ 9422 + "async-compression", 9422 9423 "bitflags 2.10.0", 9423 9424 "bytes", 9424 9425 "futures-core",
+1 -1
htmlshell/Cargo.toml
··· 46 46 servo_config_macro = { path = "../source/components/config/macro" } 47 47 tokio = { workspace = true } 48 48 tower = "0.5" 49 - tower-http = { version = "0.6", features = ["cors", "fs"] } 49 + tower-http = { version = "0.6", features = ["async-compression", "compression-zstd", "cors", "fs"] } 50 50 tracing = { workspace = true, optional = true } 51 51 tracing-perfetto = { workspace = true, optional = true } 52 52 tracing-subscriber = { workspace = true, optional = true, features = ["env-filter"] }
+11 -6
htmlshell/src/vhost.rs
··· 13 13 use parking_lot::Mutex; 14 14 use servo::prefs::{PreferencesObserver, get_embedder_pref}; 15 15 use servo::{PrefValue, prefs}; 16 + use tower_http::compression::CompressionLayer; 16 17 use tower_http::cors::{Any, CorsLayer}; 17 18 use tower_http::services::ServeFile; 18 19 use tower_http::services::fs::ServeFileSystemResponseBody; ··· 49 50 50 51 // Currently recognized: system, shared, keyboard, homescreen, theme 51 52 // TODO: don't hardcode 52 - if app != "homescreen" && 53 - app != "keyboard" && 54 - app != "settings" && 55 - app != "shared" && 56 - app != "system" && 57 - app != "theme" 53 + if app != "homescreen" 54 + && app != "keyboard" 55 + && app != "settings" 56 + && app != "shared" 57 + && app != "system" 58 + && app != "theme" 58 59 { 59 60 return None; 60 61 } ··· 141 142 .allow_methods(Any) 142 143 .allow_headers(Any); 143 144 145 + let compression = CompressionLayer::new() 146 + .zstd(true); 147 + 144 148 let app = Router::new() 145 149 .route("/{*key}", get(get_file)) 146 150 .layer(cors) 151 + .layer(compression) 147 152 .with_state(state); 148 153 149 154 servo::Servo::spawn_task(async move {