1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-30 00:29:29 +02:00

add custom request path quoter #182

This commit is contained in:
Nikolay Kim
2018-04-17 12:55:13 -07:00
parent 3a79505a44
commit a826d113ee
12 changed files with 236 additions and 35 deletions

View File

@@ -2,8 +2,8 @@ use bytes::{Bytes, BytesMut};
use futures::{Future, Poll, Stream};
use http::header::CONTENT_LENGTH;
use std::fmt;
use std::rc::Rc;
use std::ops::{Deref, DerefMut};
use std::rc::Rc;
use mime;
use serde::Serialize;
@@ -193,7 +193,7 @@ impl<S> JsonConfig<S> {
/// Set custom error handler
pub fn error_handler<F>(&mut self, f: F) -> &mut Self
where
F: Fn(JsonPayloadError, HttpRequest<S>) -> Error + 'static
F: Fn(JsonPayloadError, HttpRequest<S>) -> Error + 'static,
{
self.ehandler = Rc::new(f);
self
@@ -202,8 +202,10 @@ impl<S> JsonConfig<S> {
impl<S> Default for JsonConfig<S> {
fn default() -> Self {
JsonConfig { limit: 262_144,
ehandler: Rc::new(|e, _| e.into()) }
JsonConfig {
limit: 262_144,
ehandler: Rc::new(|e, _| e.into()),
}
}
}