From e7f05fc3b45e3e068e8a8373782e7f519f40690d Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 29 Mar 2023 08:28:56 +0000 Subject: feat(router): modify content from post-route callback --- examples/windmark.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/windmark.rs b/examples/windmark.rs index fca1c97..b33f686 100644 --- a/examples/windmark.rs +++ b/examples/windmark.rs @@ -82,7 +82,9 @@ async fn main() -> Result<(), Box> { context.url.to_string() ) })); - router.set_post_route_callback(Box::new(|context| { + router.set_post_route_callback(Box::new(|context, content| { + *content = content.replace("Welcome!", "Welcome to Windmark!"); + info!( "closed connection from {}", context.tcp.peer_addr().unwrap().ip() -- cgit v1.2.3