Skip to content

Commit

Permalink
Revert "ugly hack: temporarily force JSON decoding" (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdtfh authored Nov 30, 2023
1 parent 9ba7f74 commit 4915f91
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 95 deletions.
23 changes: 0 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ redis = { version = "0.23.0", features = ["tokio-comp", "connection-manager", "t
tracing-subscriber = { version = "0.3", default-features = false, features = [
"fmt","json"
] }
serde_path_to_error = "0.1.14"
async-trait = "0.1.74"
thiserror = "1.0.50"

[build-dependencies]
chrono = "0.4.26"
62 changes: 0 additions & 62 deletions src/axum/mod.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use dotenvy::dotenv;
use redis::aio::ConnectionManager;
use std::env;

mod axum;
mod routes;
mod server;
mod utils;
Expand Down
9 changes: 3 additions & 6 deletions src/routes/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@ use std::str;
use tower_http::cors::{AllowHeaders, Any, CorsLayer};
use uuid::Uuid;

use crate::{
axum::TemporaryForceDecodeJson,
utils::{
handle_redis_error, RequestPayload, RequestStatus, EXPIRE_AFTER_SECONDS, REQ_STATUS_PREFIX,
},
use crate::utils::{
handle_redis_error, RequestPayload, RequestStatus, EXPIRE_AFTER_SECONDS, REQ_STATUS_PREFIX,
};

const RES_PREFIX: &str = "res:";
Expand Down Expand Up @@ -84,7 +81,7 @@ async fn get_response(
async fn insert_response(
Path(request_id): Path<Uuid>,
Extension(mut redis): Extension<ConnectionManager>,
TemporaryForceDecodeJson(request): TemporaryForceDecodeJson<RequestPayload>,
Json(request): Json<RequestPayload>,
) -> Result<StatusCode, StatusCode> {
//ANCHOR - Check the request is valid
if !redis
Expand Down

0 comments on commit 4915f91

Please sign in to comment.