mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew
synced 2026-08-26 15:02:18 +08:00
Move response encryption handler to a response handler
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
use jzon::object;
|
||||
use actix_web::{web, HttpRequest, Responder};
|
||||
use actix_web::{web, Responder};
|
||||
|
||||
use crate::router::{global, Body};
|
||||
use crate::router::{Body, Api};
|
||||
|
||||
pub fn routes(cfg: &mut web::ServiceConfig) {
|
||||
cfg.route("/debug/error", web::post().to(error));
|
||||
}
|
||||
|
||||
async fn error(req: HttpRequest, Body(body): Body) -> impl Responder {
|
||||
async fn error(Body(body): Body) -> impl Responder {
|
||||
|
||||
println!("client error: {}", body["code"]);
|
||||
|
||||
global::api(&req, Some(object!{}))
|
||||
Api(Some(object!{}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user