Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
BrooksCunningham committed Sep 13, 2024
1 parent 66d95bf commit e8813bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/fanout_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub fn grip_response(ctype: &str, ghold: &str, chan: &str) -> Response {
.with_header("Content-Type", ctype)
.with_header("Grip-Hold", ghold)
.with_header("Grip-Channel", chan)
.with_body("")
.with_body("{\"msg\":\"hello world\"}")
}

/// Returns a WebSocket-over-HTTP formatted TEXT message
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ fn status(mut req: &Request, mut resp: Response) -> Result<Response, Error> {
if path_segments.len() < 2 {
resp.set_status(500);
let data = serde_json::json!({ "error": "unable to parse status code properly. Try sending request like /status/302"});
resp.set_body_json(&data);
let _ = resp.set_body_json(&data);
return Ok(resp);
}

Expand Down Expand Up @@ -289,7 +289,7 @@ fn get_static_asset(req: &Request, mut resp: Response) -> Result<Response, Error
fn chatroom(req: Request, _resp: Response) -> Result<Response, Error> {
// resp.set_body_text_plain("chatroom response");
let chan = "chatroomtest";
let resp = match req.get_url().path() {
let resp: Response = match req.get_url().path() {
// "/chatroom" => fanout_util::handle_fanout_ws(req, chan),
"/chatroom" => fanout_util::grip_response("text/plain", "response", chan),
"/chatroom/test/long-poll" => fanout_util::grip_response("text/plain", "response", chan),
Expand Down

0 comments on commit e8813bd

Please sign in to comment.