diff --git a/server/src/web/api.rs b/server/src/web/api.rs index deb6efb4..2bbc96f2 100644 --- a/server/src/web/api.rs +++ b/server/src/web/api.rs @@ -10,8 +10,8 @@ use std::{ use futures::{future, Future}; use hyper::{ service::Service, - StatusCode, header, + StatusCode, Method, Body, Request, @@ -153,7 +153,7 @@ impl ApiService { /// Retrieve any messages past the given cursor index, and if /// there weren't any, subscribe to receive any new messages. fn handle_api_subscribe(&self, request: Request
) -> Response { - let argument = &request.uri().path()["/api/subscribe".len()..]; + let argument = &request.uri().path()["/api/subscribe/".len()..]; let cursor: u32 = match argument.parse() { Ok(v) => v, Err(err) => { @@ -206,7 +206,7 @@ impl ApiService { } fn handle_api_read(&self, request: Request) -> Response { - let argument = &request.uri().path()["/api/subscribe".len()..]; + let argument = &request.uri().path()["/api/read/".len()..]; let requested_ids: Option