From b0565f96f674c6bdce8d40baf8c048626eb9ecfe Mon Sep 17 00:00:00 2001 From: Andy Gayton Date: Wed, 15 May 2024 10:52:37 -0400 Subject: [PATCH] wip --- src/http.rs | 4 +++- tests/integration.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/http.rs b/src/http.rs index 6361e41..91f05b5 100644 --- a/src/http.rs +++ b/src/http.rs @@ -36,6 +36,8 @@ async fn get(store: Store, _req: Request) -> HTTPResult { async fn post(mut store: Store, req: Request) -> HTTPResult { let (parts, mut body) = req.into_parts(); + eprintln!("parts: {:?}", &parts); + eprintln!("uri: {:?}", &parts.uri.path()); let writer = store.cas_open().await?; @@ -49,7 +51,7 @@ async fn post(mut store: Store, req: Request) -> HTTPResu let writer = writer.into_inner(); let hash = writer.commit().await?; - let frame = store.append("".to_string(), Some(hash)).await; + let frame = store.append(parts.uri.path().to_string(), Some(hash)).await; Ok(Response::builder() .status(StatusCode::OK) diff --git a/tests/integration.rs b/tests/integration.rs index d6adfc1..226a630 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -18,7 +18,7 @@ async fn test_integration() { tokio::time::sleep(Duration::from_millis(500)).await; let output = cmd!("sh", "-c", format!( - "date | curl -v --data-binary @- --unix-socket {}/sock 'localhost/stream.cross.pasteboard?foo=bar'", + "date | curl -v -X POST -T - --unix-socket {}/sock 'localhost/stream/cross/pasteboard?foo=bar'", temp_dir.path().display() )) .stderr_to_stdout()