mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 02:27:40 +08:00
fix issues from review
Co-authored-by: Clément Renault <clement@meilisearch.com>
This commit is contained in:
parent
305665cd42
commit
b96da94f92
@ -3,10 +3,10 @@
|
||||
- Add support for faceted search (#631)
|
||||
- Add support for configuring the lmdb map size (#646, #647)
|
||||
- Add exposed port for Dockerfile (#654)
|
||||
- Add sentry probe
|
||||
- Add sentry probe (#664)
|
||||
- Fix url trailing slash and double slash issues (#659)
|
||||
- Fix accept all Content-Type by default (#653)
|
||||
- Return the error message from Serde when a deserialization error is encountered
|
||||
- Return the error message from Serde when a deserialization error is encountered (#661)
|
||||
|
||||
## v0.10.1
|
||||
|
||||
|
@ -201,10 +201,10 @@ impl From<actix_http::Error> for ResponseError {
|
||||
impl From<JsonPayloadError> for ResponseError {
|
||||
fn from(err: JsonPayloadError) -> ResponseError {
|
||||
match err {
|
||||
JsonPayloadError::Deserialize(err) => ResponseError::BadRequest(format!("BAD_JSON: {}", err)),
|
||||
JsonPayloadError::Deserialize(err) => ResponseError::BadRequest(format!("Invalid JSON: {}", err)),
|
||||
JsonPayloadError::Overflow => ResponseError::PayloadTooLarge,
|
||||
JsonPayloadError::ContentType => ResponseError::UnsupportedMediaType,
|
||||
JsonPayloadError::Payload(err) => ResponseError::BadRequest(format!("Problem decoding request: {}", err)),
|
||||
JsonPayloadError::Payload(err) => ResponseError::BadRequest(format!("Problem while decoding the request: {}", err)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
/// This middleware normalizes slashes in paths
|
||||
/// * consecutive instances of `/` get collapsed into one `/`
|
||||
/// * any ending `/` is removed.
|
||||
/// Original source from: https://gitlab.com/snippets/1884466
|
||||
///
|
||||
/// Ex:
|
||||
/// /this///url/
|
||||
@ -69,7 +70,7 @@ where
|
||||
|
||||
let path = match parts.path_and_query.as_ref().map(|pq| pq.query()).flatten() {
|
||||
Some(q) => bytes::Bytes::from(format!("{}?{}", new_path, q)),
|
||||
None =>bytes::Bytes::from(format!("{}", new_path))
|
||||
None => bytes::Bytes::from(new_path.to_string()),
|
||||
};
|
||||
|
||||
if let Ok(pq) = PathAndQuery::from_maybe_shared(path) {
|
||||
|
@ -31,7 +31,7 @@ pub fn create_app(
|
||||
.app_data(web::Data::new(data.clone()))
|
||||
.app_data(
|
||||
web::JsonConfig::default()
|
||||
.limit(1024 * 1024 * 10)
|
||||
.limit(1024 * 1024 * 10) // Json Limit of 10Mb
|
||||
.content_type(|_mime| true) // Accept all mime types
|
||||
.error_handler(|err, _req| json_error_handler(err).into()),
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user