Expires header works again.

Match the direct hyper dependency with the one in nickel.rs
and things work fine agin.
This commit is contained in:
Rasmus Kaj 2015-11-27 18:38:46 +01:00
parent ce4c362e60
commit 0ffa72a1db
2 changed files with 3 additions and 6 deletions

View File

@ -21,6 +21,6 @@ rustc-serialize = "*"
typemap = "*"
plugin = "*"
image = "*"
hyper = "*"
hyper = "0.6.16"
time = "*"
xml-rs = "*"

View File

@ -117,8 +117,7 @@ fn main() {
if let Ok(photo) = req.orm_get::<Photo>("id", &id) {
let buf = get_scaled_image(photo, 200, 180);
res.set(MediaType::Jpeg);
// FIXME https://github.com/nickel-org/nickel.rs/issues/303
// res.set(Expires(HttpDate(time::now() + Duration::days(14))));
res.set(Expires(HttpDate(time::now() + Duration::days(14))));
return res.send(buf);
}
}
@ -128,9 +127,7 @@ fn main() {
if let Ok(photo) = req.orm_get::<Photo>("id", &id) {
let buf = get_scaled_image(photo, 800, 600);
res.set(MediaType::Jpeg);
// FIXME https://github.com/nickel-org/nickel.rs/issues/303
let expires = Expires(HttpDate(time::now() + Duration::days(14)));
// res.set(expires);
res.set(Expires(HttpDate(time::now() + Duration::days(14))));
return res.send(buf);
}
}