You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
externcrate hyper;use hyper::server::{Request,Response};use std::io::Read;// If a github webhook client requests this route, after serving that request successfully// it will never respond to another request from any client again.fnhello(req:Request,res:Response){letmut req = req;println!("request received, processing");println!("loading body into string");letmut payload = String::new();if req.read_to_string(&mut payload).is_err(){println!("could not read body into string");return res.send(b"nope").unwrap();}println!("done, responding");
res.send(b"yep").unwrap();}fnmain(){let _listening = hyper::Server::http("0.0.0.0:4200").unwrap().handle(hello);println!("Listening on 0.0.0.0:4200");}
This responds perfectly fine to curls but if this is set to be a GitHub webhook receiver, the server will stop accepting requests after it successfully serves the first one.
The text was updated successfully, but these errors were encountered:
Here's a minimal repro:
This responds perfectly fine to curls but if this is set to be a GitHub webhook receiver, the server will stop accepting requests after it successfully serves the first one.
The text was updated successfully, but these errors were encountered: