Use set_default_accept_language in fetch_with_cors_cache.

This commit is contained in:
Ms2ger 2016-11-07 18:16:44 +01:00
parent 184adb7495
commit d777016b3a
3 changed files with 10 additions and 7 deletions

View file

@ -12,7 +12,7 @@ use hyper::header::{Accept, AccessControlAllowCredentials, AccessControlAllowHea
use hyper::header::{AcceptEncoding, AcceptLanguage, AccessControlAllowMethods, AccessControlMaxAge};
use hyper::header::{AccessControlRequestHeaders, AccessControlRequestMethod, Date, UserAgent};
use hyper::header::{CacheControl, ContentLanguage, ContentLength, ContentType, Expires, LastModified};
use hyper::header::{Encoding, Location, Pragma, SetCookie, qitem};
use hyper::header::{Encoding, Location, Pragma, Quality, QualityItem, SetCookie, qitem};
use hyper::header::{Headers, Host, HttpDate, Referer as HyperReferer};
use hyper::method::Method;
use hyper::mime::{Mime, SubLevel, TopLevel};
@ -776,7 +776,12 @@ fn test_fetch_with_devtools() {
let mut en_us: LanguageTag = Default::default();
en_us.language = Some("en".to_owned());
en_us.region = Some("US".to_owned());
headers.set(AcceptLanguage(vec![qitem(en_us)]));
let mut en: LanguageTag = Default::default();
en.language = Some("en".to_owned());
headers.set(AcceptLanguage(vec![
qitem(en_us),
QualityItem::new(en, Quality(500)),
]));
headers.set(UserAgent(DEFAULT_USER_AGENT.to_owned()));