Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
cablehead committed May 15, 2024
1 parent f9671c8 commit b0565f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ async fn get(store: Store, _req: Request<hyper::body::Incoming>) -> HTTPResult {

async fn post(mut store: Store, req: Request<hyper::body::Incoming>) -> HTTPResult {
let (parts, mut body) = req.into_parts();
eprintln!("parts: {:?}", &parts);
eprintln!("uri: {:?}", &parts.uri.path());

let writer = store.cas_open().await?;

Expand All @@ -49,7 +51,7 @@ async fn post(mut store: Store, req: Request<hyper::body::Incoming>) -> 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)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit b0565f9

Please sign in to comment.