mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
Merge #232
232: Fix payload size limit r=MarinPostma a=MarinPostma Fix #223 This was due to the fact that Payload ignores the limit payload size limit. I fixed it by implementing my own `Payload` extractor that checks that the size of the payload is not too large. I also refactored the `create_app` a bit. Co-authored-by: marin postma <postma.marin@protonmail.com>
This commit is contained in:
commit
8638c9ab77
16 changed files with 231 additions and 110 deletions
|
@ -1,4 +1,3 @@
|
|||
use actix_web::web::Payload;
|
||||
use actix_web::{delete, get, post, put};
|
||||
use actix_web::{web, HttpResponse};
|
||||
use indexmap::IndexMap;
|
||||
|
@ -8,6 +7,7 @@ use serde::Deserialize;
|
|||
use serde_json::Value;
|
||||
|
||||
use crate::error::ResponseError;
|
||||
use crate::extractors::payload::Payload;
|
||||
use crate::helpers::Authentication;
|
||||
use crate::routes::IndexParam;
|
||||
use crate::Data;
|
||||
|
@ -174,7 +174,7 @@ async fn update_documents(
|
|||
data: web::Data<Data>,
|
||||
path: web::Path<IndexParam>,
|
||||
params: web::Query<UpdateDocumentsQuery>,
|
||||
body: web::Payload,
|
||||
body: Payload,
|
||||
) -> Result<HttpResponse, ResponseError> {
|
||||
let update = data
|
||||
.add_documents(
|
||||
|
|
|
@ -6,7 +6,7 @@ use serde_json::Value;
|
|||
|
||||
use crate::error::ResponseError;
|
||||
use crate::helpers::Authentication;
|
||||
use crate::index::{SearchQuery, default_crop_length, DEFAULT_SEARCH_LIMIT};
|
||||
use crate::index::{default_crop_length, SearchQuery, DEFAULT_SEARCH_LIMIT};
|
||||
use crate::routes::IndexParam;
|
||||
use crate::Data;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue