assorted fixes

This commit is contained in:
Aiden McClelland
2021-08-13 12:34:29 -06:00
committed by Aiden McClelland
parent 7aaeefc180
commit c18a119c70
10 changed files with 154 additions and 75 deletions

View File

@@ -20,6 +20,7 @@ use tokio_tungstenite::WebSocketStream;
pub use self::model::DatabaseModel;
use self::util::WithRevision;
use crate::context::{EitherContext, RpcContext};
use crate::middleware::auth::is_authed;
use crate::util::{display_serializable, IoFormat};
use crate::{Error, ResultExt};
@@ -55,6 +56,9 @@ async fn ws_handler<
}
pub async fn subscribe(ctx: RpcContext, req: Request<Body>) -> Result<Response<Body>, Error> {
let (parts, body) = req.into_parts();
// is_authed(&ctx, &parts).await?;
let req = Request::from_parts(parts, body);
let (res, ws_fut) = hyper_ws_listener::create_ws(req).with_kind(crate::ErrorKind::Network)?;
if let Some(ws_fut) = ws_fut {
tokio::task::spawn(async move {