1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-30 18:34:36 +01:00

no need for custom cookie module

This commit is contained in:
Nikolay Kim 2018-01-13 11:33:42 -08:00
parent bc6bb9984f
commit b805d87ee7
2 changed files with 4 additions and 6 deletions

View File

@ -12,7 +12,7 @@ categories = ["network-programming", "asynchronous",
"web-programming::http-server", "web-programming::websocket"] "web-programming::http-server", "web-programming::websocket"]
license = "MIT/Apache-2.0" license = "MIT/Apache-2.0"
exclude = [".gitignore", ".travis.yml", ".cargo/config", exclude = [".gitignore", ".travis.yml", ".cargo/config",
"appveyor.yml", "examples/static"] "appveyor.yml", "./examples/static/*"]
build = "build.rs" build = "build.rs"
[badges] [badges]
@ -56,10 +56,7 @@ smallvec = "0.6"
bitflags = "1.0" bitflags = "1.0"
num_cpus = "1.0" num_cpus = "1.0"
flate2 = "1.0" flate2 = "1.0"
cookie = { version="0.10", features=["percent-encode", "secure"] }
# ring nightly compilation bug
# cookie = { version="0.10", features=["percent-encode", "secure"] }
cookie = { git="https://github.com/alexcrichton/cookie-rs.git", features=["percent-encode", "secure"] }
# io # io
mio = "0.6" mio = "0.6"

View File

@ -9,8 +9,10 @@ use std::path::{Path, PathBuf};
use std::ops::{Deref, DerefMut}; use std::ops::{Deref, DerefMut};
use mime_guess::get_mime_type; use mime_guess::get_mime_type;
use param::FromParam; use param::FromParam;
use handler::{Handler, Responder}; use handler::{Handler, Responder};
use headers::ContentEncoding;
use httprequest::HttpRequest; use httprequest::HttpRequest;
use httpresponse::HttpResponse; use httpresponse::HttpResponse;
use httpcodes::HTTPOk; use httpcodes::HTTPOk;
@ -83,7 +85,6 @@ impl Responder for NamedFile {
fn respond_to(mut self, _: HttpRequest) -> Result<HttpResponse, io::Error> { fn respond_to(mut self, _: HttpRequest) -> Result<HttpResponse, io::Error> {
let mut resp = HTTPOk.build(); let mut resp = HTTPOk.build();
use headers::ContentEncoding;
resp.content_encoding(ContentEncoding::Identity); resp.content_encoding(ContentEncoding::Identity);
if let Some(ext) = self.path().extension() { if let Some(ext) = self.path().extension() {
let mime = get_mime_type(&ext.to_string_lossy()); let mime = get_mime_type(&ext.to_string_lossy());