Skip to content

Commit

Permalink
Update the examples in the READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmarkov committed Oct 11, 2024
1 parent 997b76f commit 6157488
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions edge-http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ where
async fn handle(&self, conn: &mut Connection<'b, T, N>) -> Result<(), Self::Error> {
let headers = conn.headers()?;

if !matches!(headers.method, Some(Method::Get)) {
if headers.method != Method::Get {
conn.initiate_response(405, Some("Method Not Allowed"), &[])
.await?;
} else if !matches!(headers.path, Some("/")) {
} else if headers.path != "/" {
conn.initiate_response(404, Some("Not Found"), &[]).await?;
} else {
conn.initiate_response(200, Some("OK"), &[("Content-Type", "text/plain")])
Expand Down
4 changes: 2 additions & 2 deletions edge-ws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,10 @@ where
async fn handle(&self, conn: &mut Connection<'b, T, N>) -> Result<(), Self::Error> {
let headers = conn.headers()?;

if !matches!(headers.method, Some(Method::Get)) {
if headers.method != Method::Get {
conn.initiate_response(405, Some("Method Not Allowed"), &[])
.await?;
} else if !matches!(headers.path, Some("/")) {
} else if headers.path != "/" {
conn.initiate_response(404, Some("Not Found"), &[]).await?;
} else if !conn.is_ws_upgrade_request()? {
conn.initiate_response(200, Some("OK"), &[("Content-Type", "text/plain")])
Expand Down

0 comments on commit 6157488

Please sign in to comment.