mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
namedirectory: handle 404 as "notFound" for lookupAddress
Change-Id: I1c4b059e5f058c4eb929cd38875ea06beaf6ee92
This commit is contained in:
@ -115,7 +115,8 @@ void NameDirectory::lookupAddress(const std::string& addr, LookupCallback cb)
|
||||
|
||||
auto ret = restbed::Http::async(req, [this,cb,addr](const std::shared_ptr<restbed::Request>&,
|
||||
const std::shared_ptr<restbed::Response>& reply) {
|
||||
if (reply->get_status_code() == 200) {
|
||||
auto code = reply->get_status_code();
|
||||
if (code == 200) {
|
||||
size_t length = getContentLength(*reply);
|
||||
if (length > MAX_RESPONSE_SIZE) {
|
||||
cb("", Response::error);
|
||||
@ -142,6 +143,8 @@ void NameDirectory::lookupAddress(const std::string& addr, LookupCallback cb)
|
||||
} else {
|
||||
cb("", Response::notFound);
|
||||
}
|
||||
} else if (code >= 400 && code < 500) {
|
||||
cb("", Response::notFound);
|
||||
} else {
|
||||
cb("", Response::error);
|
||||
}
|
||||
|
Reference in New Issue
Block a user