mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew
synced 2026-01-12 08:12:36 +08:00
Add ability to supply custom asset hash
This commit is contained in:
@@ -13,18 +13,7 @@ fn get_asset_hash(req: &HttpRequest, body: &JsonValue) -> String {
|
||||
let platform = req.headers().get("aoharu-platform").unwrap_or(&blank_header).to_str().unwrap_or("");
|
||||
let android = !platform.to_lowercase().contains("iphone");
|
||||
|
||||
let hash = if body["asset_version"] == global::ASSET_VERSION_JP {
|
||||
if android {
|
||||
global::ASSET_HASH_ANDROID_JP
|
||||
} else {
|
||||
global::ASSET_HASH_IOS_JP
|
||||
}
|
||||
} else if android {
|
||||
global::ASSET_HASH_ANDROID
|
||||
} else {
|
||||
global::ASSET_HASH_IOS
|
||||
};
|
||||
hash.to_string()
|
||||
global::get_asset_hash(body["asset_version"].to_string(), android)
|
||||
}
|
||||
|
||||
pub fn asset_hash(req: HttpRequest, body: String) -> Option<JsonValue> {
|
||||
|
||||
Reference in New Issue
Block a user