diff --git a/src/unlocker/spoofing.cpp b/src/unlocker/spoofing.cpp index 0cfad01..bcdc99f 100644 --- a/src/unlocker/spoofing.cpp +++ b/src/unlocker/spoofing.cpp @@ -754,11 +754,14 @@ void Spoofer::serverResponseHandler(const std::string& url, std::string& body, s Log::verbose("BHVR api res @ {}", url); #endif - if (url.find("api/v1/dbd-character-data/get-all") != std::string::npos) return onGetAll(body); - if (url.find("api/v1/dbd-inventories/all") != std::string::npos) return onInventoryAll(body); - if (url.find("/api/v1/messages/listV2") != std::string::npos) return onMessageList(body); - if (url.find("api/v1/dbd-character-data/bloodweb") != std::string::npos || - url.find("api/v1/dbd-character-data/bulk-spending-bloodweb") != std::string::npos) + if (url.ends_with("api/v1/dbd-inventories/all")) return onInventoryAll(body); + + if (url.find("api/v1/messages/listV2") != std::string::npos) return onMessageList(body); + + if (url.ends_with("api/v1/dbd-character-data/get-all")) return onGetAll(body); + + if (url.ends_with("api/v1/dbd-character-data/bloodweb") || + url.ends_with("api/v1/dbd-character-data/bulk-spending-bloodweb")) return onBloodweb(body, respHeaders); if (url.ends_with("api/v1/owned-products/get-update-entitlements")) return onUpdateEntitlements(url, body); @@ -769,9 +772,10 @@ void Spoofer::clientRequestHandler(const std::string& url, std::string& body, st if (url.find("bhvrdbd.com") == std::string::npos) return; std::lock_guard lock(_mtx); - if (url.find("api/v1/dbd-character-data/get-all") != std::string::npos) return onGetAllClient(body); - if (url.find("api/v1/dbd-character-data/bloodweb") != std::string::npos || - url.find("api/v1/dbd-character-data/bulk-spending-bloodweb") != std::string::npos) + if (url.ends_with("api/v1/dbd-character-data/get-all")) return onGetAllClient(body); + + if (url.ends_with("api/v1/dbd-character-data/bloodweb") || + url.ends_with("api/v1/dbd-character-data/bulk-spending-bloodweb")) return onBloodwebClient(body); if (url.ends_with("api/v1/owned-products/get-update-entitlements")) return onUpdateEntitlementsClient(url, body);