Skip to content

Commit

Permalink
update handler
Browse files Browse the repository at this point in the history
  • Loading branch information
zyj committed Jan 25, 2025
1 parent 98ea5e5 commit 023e557
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,7 @@ impl Handler {
// make sure the request is a query and the message type is a query
if request.op_code() != OpCode::Query || request.message_type() != MessageType::Query {
let builder = MessageResponseBuilder::from_message_request(request);
let mut header = Header::response_from_request(request.header());
header.set_response_code(ResponseCode::Refused);
let res = builder.build_no_records(header);
let res = builder.error_msg(request.header(), ResponseCode::Refused);
return Ok(response.send_response(res).await?);
}

Expand Down

0 comments on commit 023e557

Please sign in to comment.