@@ -30,7 +30,7 @@ impl FilterConfig {
3030
3131impl < EHF : EnvoyHttpFilter > HttpFilterConfig < EHF > for FilterConfig {
3232 /// This is called for each new HTTP filter.
33- fn new_http_filter ( & mut self , _envoy : & mut EHF ) -> Box < dyn HttpFilter < EHF > > {
33+ fn new_http_filter ( & self , _envoy : & mut EHF ) -> Box < dyn HttpFilter < EHF > > {
3434 Box :: new ( Filter {
3535 re : self . re . clone ( ) ,
3636 } )
@@ -61,7 +61,7 @@ impl<EHF: EnvoyHttpFilter> HttpFilter<EHF> for Filter {
6161 // [`EnvoyMutBuffer`]s. Each [`EnvoyMutBuffer`] is a mutable buffer that can be
6262 // used to read the body data.
6363 let data = envoy_filter
64- . get_request_body ( )
64+ . get_buffered_request_body ( )
6565 . expect ( "Failed to get request body" ) ;
6666 let mut body_reader = BodyReader :: new ( data) ;
6767 let matched = self
@@ -70,7 +70,7 @@ impl<EHF: EnvoyHttpFilter> HttpFilter<EHF> for Filter {
7070 . expect ( "Failed to do regex match" ) ;
7171 if matched {
7272 // If the regex matches, we send a 403 response.
73- envoy_filter. send_response ( 403 , vec ! [ ] , Some ( b"Access forbidden" ) ) ;
73+ envoy_filter. send_response ( 403 , vec ! [ ] , Some ( b"Access forbidden" ) , None ) ;
7474 return abi:: envoy_dynamic_module_type_on_http_filter_request_body_status:: StopIterationNoBuffer ;
7575 }
7676 abi:: envoy_dynamic_module_type_on_http_filter_request_body_status:: Continue
@@ -136,7 +136,7 @@ mod tests {
136136
137137 // End of stream and matching regex, so we should send a 403 response.
138138 envoy_filter
139- . expect_get_request_body ( )
139+ . expect_get_buffered_request_body ( )
140140 . returning ( || {
141141 static mut HELLO : [ u8 ; 6 ] = * b"Hello " ;
142142 static mut WORLD : [ u8 ; 6 ] = * b"World!" ;
@@ -148,14 +148,14 @@ mod tests {
148148 . times ( 1 ) ;
149149 envoy_filter
150150 . expect_send_response ( )
151- . withf ( |status, _, _| * status == 403 )
152- . returning ( |_, _, _| { } )
151+ . withf ( |status, _, _, _ | * status == 403 )
152+ . returning ( |_, _, _, _ | { } )
153153 . times ( 1 ) ;
154154 assert_eq ! ( filter. on_request_body( & mut envoy_filter, true ) , abi:: envoy_dynamic_module_type_on_http_filter_request_body_status:: StopIterationNoBuffer ) ;
155155
156156 // End of stream and not matching regex, so we should continue.
157157 envoy_filter
158- . expect_get_request_body ( )
158+ . expect_get_buffered_request_body ( )
159159 . returning ( || {
160160 static mut GOOD : [ u8 ; 5 ] = * b"Good " ;
161161 static mut MORNING : [ u8 ; 8 ] = * b"Morning!" ;
0 commit comments