mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-29 16:24:26 +01:00
add payload limit to app config
This commit is contained in:
parent
1c13100948
commit
4b292c6e9b
@ -28,7 +28,7 @@ pub fn configure_data(config: &mut web::ServiceConfig, data: Data) {
|
||||
.content_type(|_mime| true) // Accept all mime types
|
||||
.error_handler(|err, _req| error::payload_error_handler(err).into()),
|
||||
)
|
||||
.app_data(web::PayloadConfig::new(http_payload_size_limit))
|
||||
.app_data(PayloadConfig::new(http_payload_size_limit))
|
||||
.app_data(
|
||||
web::QueryConfig::default()
|
||||
.error_handler(|err, _req| error::payload_error_handler(err).into()),
|
||||
@ -116,6 +116,10 @@ pub struct PayloadConfig {
|
||||
limit: usize,
|
||||
}
|
||||
|
||||
impl PayloadConfig {
|
||||
pub fn new(limit: usize) -> Self { Self { limit } }
|
||||
}
|
||||
|
||||
impl Default for PayloadConfig {
|
||||
fn default() -> Self {
|
||||
Self { limit: 256 * 1024 }
|
||||
|
Loading…
Reference in New Issue
Block a user