refactor: split modules
This commit is contained in:
11
packages/fetch/src/core.rs
Normal file
11
packages/fetch/src/core.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
use lazy_static::lazy_static;
|
||||
|
||||
lazy_static! {
|
||||
static ref DEFAULT_HTTP_CLIENT_USER_AGENT: Vec<String> =
|
||||
serde_json::from_str::<Vec<String>>(include_str!("./ua.json")).unwrap();
|
||||
}
|
||||
|
||||
pub fn get_random_mobile_ua() -> &'static str {
|
||||
DEFAULT_HTTP_CLIENT_USER_AGENT[fastrand::usize(0..DEFAULT_HTTP_CLIENT_USER_AGENT.len())]
|
||||
.as_str()
|
||||
}
|
||||
Reference in New Issue
Block a user