Skip to content

Commit

Permalink
fix: dont require json content type
Browse files Browse the repository at this point in the history
  • Loading branch information
Threated committed Jul 30, 2024
1 parent cf3b8ee commit 322d396
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
use axum::{
extract::{Json, Path, Query, State},
http::{HeaderMap, HeaderValue},
response::{sse::Event, IntoResponse, Sse},
routing::{get, post},
Router
body::Bytes, extract::{Json, Path, Query, State}, http::{HeaderMap, HeaderValue}, response::{sse::Event, IntoResponse, Sse}, routing::{get, post}, Router
};
use mini_moka::sync::Cache;
use std::{convert::Infallible, sync::Arc, time::Duration};
Expand Down Expand Up @@ -88,8 +84,9 @@ async fn handler_health() -> Json<HealthOutput> {

async fn handle_create_beam_task(
State(SharedState { results }): State<SharedState>,
Json(query): Json<LensQuery>,
body: Bytes,
) -> Result<impl IntoResponse, StatusCode> {
let query = serde_json::from_slice(&body).map_err(|_| StatusCode::BAD_REQUEST)?;
#[derive(Serialize, Deserialize, Debug)]
pub struct CqlQuery {
pub lib: Value,
Expand Down

0 comments on commit 322d396

Please sign in to comment.