1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 22:49:21 +02:00

Render error and return as response body

This commit is contained in:
Nikolay Kim
2019-04-03 19:55:19 -07:00
parent 954fe21751
commit 1e2bd68e83
5 changed files with 27 additions and 22 deletions

View File

@ -417,12 +417,7 @@ impl FormatText {
))
};
}
FormatText::UrlPath => {
*self = FormatText::Str(format!(
"{}",
req.path()
))
}
FormatText::UrlPath => *self = FormatText::Str(format!("{}", req.path())),
FormatText::RequestTime => {
*self = FormatText::Str(format!(
"{:?}",
@ -489,7 +484,9 @@ mod tests {
let req = TestRequest::with_header(
header::USER_AGENT,
header::HeaderValue::from_static("ACTIX-WEB"),
).uri("/test/route/yeah").to_srv_request();
)
.uri("/test/route/yeah")
.to_srv_request();
let now = time::now();
for unit in &mut format.0 {