mirror of
https://github.com/tdlight-team/tdlight-telegram-bot-api.git
synced 2024-11-30 16:02:56 +01:00
Improve HTTP error code for requests with unacceptable bot token.
This commit is contained in:
parent
a1e7249750
commit
baa16f5e87
@ -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(':')));
|
||||
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()) {
|
||||
|
Loading…
Reference in New Issue
Block a user