Improve HTTP error code for requests with unacceptable bot token.
This commit is contained in:
parent
e45aad4e37
commit
d1357efe78
1 changed files with 1 additions and 1 deletions
|
|
@ -70,7 +70,7 @@ void ClientManager::send(PromisedQueryPtr query) {
|
||||||
}
|
}
|
||||||
auto r_user_id = td::to_integer_safe<td::int64>(query->token().substr(0, token.find(':')));
|
auto r_user_id = td::to_integer_safe<td::int64>(query->token().substr(0, token.find(':')));
|
||||||
if (r_user_id.is_error() || r_user_id.ok() < 0 || !token_range_(r_user_id.ok())) {
|
if (r_user_id.is_error() || r_user_id.ok() < 0 || !token_range_(r_user_id.ok())) {
|
||||||
return fail_query(401, "Unauthorized: unallowed token specified", std::move(query));
|
return fail_query(421, "Misdirected Request: unallowed token specified", std::move(query));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query->is_test_dc()) {
|
if (query->is_test_dc()) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue