Check for region specific items when sending userdata

This commit is contained in:
Ethan O'Brien
2024-05-31 21:34:11 -05:00
parent 53c9f7ea9c
commit 23c09cd4d3
7 changed files with 42 additions and 9 deletions

View File

@@ -26,6 +26,7 @@ fn unhandled(req: HttpRequest, body: String) -> Option<JsonValue> {
}
fn api_req(req: HttpRequest, body: String) -> HttpResponse {
let headers = req.headers().clone();
if !req.path().starts_with("/api") && !req.path().starts_with("/v1.0") {
return router::webui::main(req);
}
@@ -120,14 +121,14 @@ fn api_req(req: HttpRequest, body: String) -> HttpResponse {
"server_time": global::timestamp(),
"data": resp.unwrap()
};
global::send(rv, uid)
global::send(rv, uid, &headers)
} else {
let rv = object!{
"code": 2,//Idontnermemrmemremremermrme
"server_time": global::timestamp(),
"data": ""
};
global::send(rv, uid)
global::send(rv, uid, &headers)
}
}