Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
hubgeter committed Dec 4, 2024
1 parent 68ac205 commit 00a35ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion be/src/http/http_handler_with_auth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ int HttpHandlerWithAuth::on_header(HttpRequest* req) {
auth_result.status.status_code = TStatusCode::type::OK;
auth_result.status.error_msgs.clear();
} else {
HttpChannel::send_reply(req, HttpStatus::BAD_REQUEST);
HttpChannel::send_reply(req, HttpStatus::FORBIDDEN);
return -1;
}
#endif
Expand Down
8 changes: 4 additions & 4 deletions be/test/http/http_client_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ TEST_F(HttpClientTest, enable_http_auth) {
EXPECT_TRUE(!st.ok());
std::cout << "response = " << response << "\n";
std::cout << "st.msg() = " << st.msg() << "\n";
EXPECT_TRUE(st.msg().find("Operation timed out after") != std::string::npos);
EXPECT_TRUE(st.msg().find("403") != std::string::npos);
}

{
Expand Down Expand Up @@ -474,7 +474,7 @@ TEST_F(HttpClientTest, enable_http_auth) {
EXPECT_TRUE(!st.ok());
std::cout << "response = " << response << "\n";
std::cout << "st.msg() = " << st.msg() << "\n";
EXPECT_TRUE(st.msg().find("Operation timed out after") != std::string::npos);
EXPECT_TRUE(st.msg().find("403") != std::string::npos);
}

// valid token
Expand Down Expand Up @@ -521,7 +521,7 @@ TEST_F(HttpClientTest, enable_http_auth) {
EXPECT_TRUE(!st.ok());
std::cout << "response = " << response << "\n";
std::cout << "st.msg() = " << st.msg() << "\n";
EXPECT_TRUE(st.msg().find("Operation timed out after") != std::string::npos);
EXPECT_TRUE(st.msg().find("403") != std::string::npos);
}

std::vector<std::string> check_get_list = {"/api/clear_cache/aa",
Expand Down Expand Up @@ -566,7 +566,7 @@ TEST_F(HttpClientTest, enable_http_auth) {
EXPECT_TRUE(!st.ok());
std::cout << "response = " << response << "\n";
std::cout << "st.msg() = " << st.msg() << "\n";
EXPECT_TRUE(st.msg().find("Operation timed out after") != std::string::npos);
EXPECT_TRUE(st.msg().find("403") != std::string::npos);
}
}
}
Expand Down

0 comments on commit 00a35ee

Please sign in to comment.