envoy-wasm-rust-sdk icon indicating copy to clipboard operation
envoy-wasm-rust-sdk copied to clipboard

Filter blocked after a request

Open Gsantomaggio opened this issue 4 years ago • 1 comments
trafficstars

Hi, I followed the getting started https://www.getenvoy.io/tutorials/getting-started-http-filter-rust/

then I changed the filter, just to try the response, but after the first request the filter gets blocked

 if let Err(err) = &filter_ops.send_response(403,
                                                   &[("form", "envoy filter")],
                                                   Some(b"Access forbidden.\n")) {

            info!("error {}", &err);

        }
        info!("******* request sent");

        Ok(http::FilterHeadersStatus::StopIteration)

The first request works:

< HTTP/1.1 403 Forbidden                                                                                                                                                                                                             
< content-length: 18                                                                                                                                                                                                                 
< content-type: text/plain                                                                                                                                                                                                           
< form: envoy filter                                                                                                                                                                                                                 
< date: Sun, 10 Jan 2021 18:06:30 GMT                                                                                                                                                                                                
< server: envoy  

Then it doesn't work anymore.

Thank you for the sdk

Gsantomaggio avatar Jan 10 '21 18:01 Gsantomaggio

+1 send_response() does not work

Raz0r avatar Mar 11 '21 16:03 Raz0r