File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ impl Service for UploadService {
19
19
. unwrap ( ) )
20
20
}
21
21
22
- fn should_continue ( & self , req : & Request < Body > ) -> StatusCode {
22
+ fn should_continue ( & mut self , req : & Request < Body > ) -> StatusCode {
23
23
match req. headers ( ) . typed_get :: < headers:: ContentLength > ( ) {
24
24
Some ( len) if len. 0 <= self . max_length => StatusCode :: CONTINUE ,
25
25
_ => StatusCode :: EXPECTATION_FAILED ,
Original file line number Diff line number Diff line change @@ -72,14 +72,14 @@ type IncomingRequest = Request<Body>;
72
72
/// type Body = &'static str;
73
73
/// type Error = Infallible;
74
74
///
75
- /// fn call(&self, _req: Request<Body>) -> Result<http::Response<Self::Body>, Self::Error> {
75
+ /// fn call(&mut self, _req: Request<Body>) -> Result<http::Response<Self::Body>, Self::Error> {
76
76
/// Ok(Response::builder()
77
77
/// .status(StatusCode::OK)
78
78
/// .body("Thanks for the info!")
79
79
/// .unwrap())
80
80
/// }
81
81
///
82
- /// fn should_continue(&self, req: &Request<Body>) -> StatusCode {
82
+ /// fn should_continue(&mut self, req: &Request<Body>) -> StatusCode {
83
83
/// match req.headers().typed_get::<headers::ContentLength>() {
84
84
/// Some(len) if len.0 <= self.max_length => StatusCode::CONTINUE,
85
85
/// _ => StatusCode::EXPECTATION_FAILED,
@@ -97,7 +97,7 @@ pub trait Service {
97
97
98
98
fn call ( & mut self , request : IncomingRequest ) -> Result < Response < Self :: Body > , Self :: Error > ;
99
99
100
- fn should_continue ( & self , _: & IncomingRequest ) -> StatusCode {
100
+ fn should_continue ( & mut self , _: & IncomingRequest ) -> StatusCode {
101
101
StatusCode :: CONTINUE
102
102
}
103
103
}
You can’t perform that action at this time.
0 commit comments