-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Labels
Description
was trying to implement a workaround for #88 :
pub fn serve(directory: &Path) -> Result<()> {
let host = "127.0.0.1";
let port = "7878";
let server = Server::new(|request, mut response| {
println!("got {}", request.uri().path());
response.status(301);
response.header(http::header::LOCATION, "/index.html".as_bytes());
Ok(response.body("".as_bytes())?)
});
env::set_current_dir(directory)?;
println!("serving at http://{}:{}", host, port);
server.listen(host, port);
Ok(())
}
the 301 comes through, but not the location header. I don't know why...