Skip to content

Commit

Permalink
compression middleware #194
Browse files Browse the repository at this point in the history
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
  • Loading branch information
yoshuawuyts committed Nov 3, 2019
1 parent 7ece9c1 commit dd3302c
Show file tree
Hide file tree
Showing 4 changed files with 419 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ serde_json = "1.0.41"
typemap = "0.3.3"
serde_urlencoded = "0.6.1"
log = "0.4.8"
accept-encoding = "0.2.0-alpha.2"
async-compression = "0.1.0-alpha.7"

[dependencies.http-service-hyper]
optional = true
Expand Down
5 changes: 5 additions & 0 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ impl<State> Context<State> {
&self.request
}

/// Access a mutable handle to the entire request.
pub fn request_mut(&mut self) -> &mut http_service::Request {
&mut self.request
}

/// Access app-global state.
pub fn state(&self) -> &State {
&self.state
Expand Down
Loading

0 comments on commit dd3302c

Please sign in to comment.