1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-07-04 01:51:30 +02:00

Compare commits

...

4 Commits

Author SHA1 Message Date
29a0fe76d5 prepare actix-web-codegen release 2019-06-01 17:21:22 +06:00
7753b9da6d web-codegen: Add extra-traits to syn features (#879)
```rust
error[E0277]: `syn::attr::NestedMeta` doesn't implement `std::fmt::Debug`
   --> src/route.rs:149:57
    |
149 |                 attr => panic!("Unknown attribute{:?}", attr),
    |                                                         ^^^^ `syn::attr::NestedMeta` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `syn::attr::NestedMeta`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&syn::attr::NestedMeta`
    = note: required by `std::fmt::Debug::fmt`
```
2019-06-01 14:13:45 +06:00
f1764bba43 Fix Logger time format (use rfc3339) (#867)
* Fix Logger time format (use rfc3339)

* Update change log
2019-05-31 12:09:21 +04:00
c2d7db7e06 prepare actix-web-actors release 2019-05-29 16:22:57 -07:00
10 changed files with 51 additions and 17 deletions

View File

@ -15,6 +15,8 @@
### Fixed
* Fix Logger request time format, and use rfc3339. #867
* Clear http requests pool on app service drop #860

View File

@ -73,7 +73,7 @@ actix-utils = "0.4.1"
actix-router = "0.1.5"
actix-rt = "0.2.2"
actix-web-codegen = "0.1.0"
actix-http = "0.2.0"
actix-http = "0.2.2"
actix-server = "0.5.1"
actix-server-config = "0.1.1"
actix-threadpool = "0.1.0"
@ -100,7 +100,7 @@ openssl = { version="0.10", optional = true }
rustls = { version = "0.15", optional = true }
[dev-dependencies]
actix-http = { version = "0.2.0", features=["ssl", "brotli", "flate2-zlib"] }
actix-http = { version = "0.2.2", features=["ssl", "brotli", "flate2-zlib"] }
actix-http-test = { version = "0.2.0", features=["ssl"] }
actix-files = { version = "0.1.0" }
rand = "0.6"

View File

@ -81,7 +81,7 @@ time = "0.1.42"
tokio-tcp = "0.1.3"
tokio-timer = "0.2.8"
tokio-current-thread = "0.1"
trust-dns-resolver = { version="0.11.0", default-features = false }
trust-dns-resolver = { version="0.11.1", default-features = false }
# for secure cookie
ring = { version = "0.14.6", optional = true }

View File

@ -1,5 +1,9 @@
# Changes
## [1.0.0] - 2019-05-29
* Update actix-http and actix-web
## [0.1.0-alpha.3] - 2019-04-02
* Update actix-http and actix-web

View File

@ -1,6 +1,6 @@
[package]
name = "actix-web-actors"
version = "1.0.0-beta.4"
version = "1.0.0"
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
description = "Actix actors support for actix web framework."
readme = "README.md"
@ -18,9 +18,9 @@ name = "actix_web_actors"
path = "src/lib.rs"
[dependencies]
actix = "0.8.2"
actix-web = "1.0.0-beta.5"
actix-http = "0.2.0"
actix = "0.8.3"
actix-web = "1.0.0-rc"
actix-http = "0.2.2"
actix-codec = "0.1.2"
bytes = "0.4"
futures = "0.1.25"

View File

@ -1,5 +1,9 @@
# Changes
## [0.1.1] - 2019-06-01
* Add syn "extra-traits" feature
## [0.1.0] - 2019-05-18
* Release

View File

@ -1,6 +1,6 @@
[package]
name = "actix-web-codegen"
version = "0.1.0"
version = "0.1.1"
description = "Actix web proc macros"
readme = "README.md"
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
@ -12,11 +12,11 @@ workspace = ".."
proc-macro = true
[dependencies]
quote = "0.6"
syn = { version = "0.15", features = ["full", "parsing"] }
quote = "0.6.12"
syn = { version = "0.15.34", features = ["full", "parsing", "extra-traits"] }
[dev-dependencies]
actix-web = { version = "1.0.0-beta.5" }
actix-http = { version = "0.2.0", features=["ssl"] }
actix-web = { version = "1.0.0-rc" }
actix-http = { version = "0.2.2", features=["ssl"] }
actix-http-test = { version = "0.2.0", features=["ssl"] }
futures = { version = "0.1" }

View File

@ -0,0 +1 @@
../LICENSE-APACHE

View File

@ -0,0 +1 @@
../LICENSE-MIT

View File

@ -53,7 +53,7 @@ use crate::HttpResponse;
///
/// `%a` Remote IP-address (IP-address of proxy if using reverse proxy)
///
/// `%t` Time when the request was started to process
/// `%t` Time when the request was started to process (in rfc3339 format)
///
/// `%r` First line of request
///
@ -417,10 +417,7 @@ impl FormatText {
}
FormatText::UrlPath => *self = FormatText::Str(format!("{}", req.path())),
FormatText::RequestTime => {
*self = FormatText::Str(format!(
"{:?}",
now.strftime("[%d/%b/%Y:%H:%M:%S %z]").unwrap()
))
*self = FormatText::Str(format!("{}", now.rfc3339()))
}
FormatText::RequestHeader(ref name) => {
let s = if let Some(val) = req.headers().get(name) {
@ -547,4 +544,29 @@ mod tests {
assert!(s.contains("200 1024"));
assert!(s.contains("ACTIX-WEB"));
}
#[test]
fn test_request_time_format() {
let mut format = Format::new("%t");
let req = TestRequest::default().to_srv_request();
let now = time::now();
for unit in &mut format.0 {
unit.render_request(now, &req);
}
let resp = HttpResponse::build(StatusCode::OK).force_close().finish();
for unit in &mut format.0 {
unit.render_response(&resp);
}
let render = |fmt: &mut Formatter| {
for unit in &format.0 {
unit.render(fmt, 1024, now)?;
}
Ok(())
};
let s = format!("{}", FormatDisplay(&render));
assert!(s.contains(&format!("{}", now.rfc3339())));
}
}