diff --git a/secret_store/src/listener/http_listener.rs b/secret_store/src/listener/http_listener.rs index 7d4385ccc..bf293a44e 100644 --- a/secret_store/src/listener/http_listener.rs +++ b/secret_store/src/listener/http_listener.rs @@ -20,7 +20,7 @@ use hyper::{self, header, Chunk, Uri, Request as HttpRequest, Response as HttpRe use hyper::server::Http; use serde::Serialize; use serde_json; -use tokio::executor::current_thread; +use tokio; use tokio::net::TcpListener; use tokio::runtime::Runtime; use tokio_service::Service; @@ -104,9 +104,7 @@ impl KeyServerHttpListener { warn!("Key server handler error: {:?}", e); }); - // TODO: Change this to tokio::spawn once hyper is Send. - current_thread::spawn(serve); - future::ok(()) + tokio::spawn(serve) }); runtime.spawn(server); @@ -207,7 +205,7 @@ impl Service for KeyServerHttpHandler { type Request = HttpRequest; type Response = HttpResponse; type Error = hyper::Error; - type Future = Box>; + type Future = Box + Send>; fn call(&self, req: HttpRequest) -> Self::Future { if req.headers().has::() { @@ -222,7 +220,7 @@ impl Service for KeyServerHttpHandler { Box::new(req.body().concat2().map(move |body| { let path = req_uri.path().to_string(); - if req_uri.is_absolute() { + if path.starts_with("/") { this.process(req_method, req_uri, &path, &body) } else { warn!(target: "secretstore", "Ignoring invalid {}-request {}", req_method, req_uri);