mirror of
https://gitee.com/zyjblog/oatpp.git
synced 2024-12-22 22:16:37 +08:00
Let the failed request use a different connection to not break the main connection
This commit is contained in:
parent
04d5fc7441
commit
8ec099e3f1
@ -233,12 +233,12 @@ void FullTest::onRun() {
|
||||
}
|
||||
|
||||
{ // test authorzation of unknown user in endpoint-code
|
||||
auto response = client->defauthorization("john:doe", connection);
|
||||
auto response = client->defauthorization("john:doe");
|
||||
OATPP_ASSERT(response->getStatusCode() == 403);
|
||||
}
|
||||
|
||||
{ // test call of an endpoint that requiers authorization headers, but we don't send one
|
||||
auto response = client->defauthorizationWithoutHeader(connection);
|
||||
auto response = client->defauthorizationWithoutHeader();
|
||||
OATPP_ASSERT(response->getStatusCode() == 401);
|
||||
oatpp::String body = response->readBodyToString();
|
||||
OATPP_ASSERT(body == "server=oatpp/" OATPP_VERSION "\n"
|
||||
@ -263,7 +263,7 @@ void FullTest::onRun() {
|
||||
|
||||
{ // test custom authorization handler with custom authorization object with unknown credentials where the
|
||||
// handler returns nullptr
|
||||
auto response = client->myauthorization("john:doe", connection);
|
||||
auto response = client->myauthorization("john:doe");
|
||||
oatpp::String body = response->readBodyToString();
|
||||
OATPP_ASSERT(response->getStatusCode() == 401);
|
||||
OATPP_ASSERT(body == "server=oatpp/" OATPP_VERSION "\n"
|
||||
|
Loading…
Reference in New Issue
Block a user