Skip to content

Commit 368bd66

Browse files
committed
compression middleware #194
Signed-off-by: Yoshua Wuyts <[email protected]>
1 parent 7ece9c1 commit 368bd66

File tree

4 files changed

+419
-3
lines changed

4 files changed

+419
-3
lines changed

Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ serde_json = "1.0.41"
3232
typemap = "0.3.3"
3333
serde_urlencoded = "0.6.1"
3434
log = "0.4.8"
35+
accept-encoding = "0.2.0-alpha.2"
36+
async-compression = "0.1.0-alpha.7"
3537

3638
[dependencies.http-service-hyper]
3739
optional = true

src/context.rs

+5
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ impl<State> Context<State> {
5555
&self.request
5656
}
5757

58+
/// Access a mutable handle to the entire request.
59+
pub fn request_mut(&mut self) -> &mut http_service::Request {
60+
&mut self.request
61+
}
62+
5863
/// Access app-global state.
5964
pub fn state(&self) -> &State {
6065
&self.state

0 commit comments

Comments
 (0)