Add /api/debug/error endpoint
This commit is contained in:
18
src/router/debug.rs
Normal file
18
src/router/debug.rs
Normal file
@ -0,0 +1,18 @@
|
||||
use json;
|
||||
use json::{object};
|
||||
use crate::router::global;
|
||||
use crate::encryption;
|
||||
use actix_web::{HttpResponse, HttpRequest};
|
||||
|
||||
pub fn error(_req: HttpRequest, body: String) -> HttpResponse {
|
||||
let body = json::parse(&encryption::decrypt_packet(&body).unwrap()).unwrap();
|
||||
|
||||
println!("client error: {}", body["code"]);
|
||||
|
||||
let resp = object!{
|
||||
"code": 4,
|
||||
"server_time": global::timestamp(),
|
||||
"message": ""
|
||||
};
|
||||
global::send(resp)
|
||||
}
|
Reference in New Issue
Block a user