Auto merge of #14059 - mrnayak:refPolicy, r=nox

Network Security : Implement StrictOrigin and StrictOriginWhenCrossOr…

This pull request contains commit implementing initial steps for Improving Network Security project. As part of initial steps referer policy enums for strict-origin and strict-origin-when-cross-origin have been added to [hyper](https://github.com/hyperium/hyper/pull/943). Unit tests and additional logic has been added to handle these policies. Since enum changes are available on hyper version 0.9.11. We had to update hyper version to 0.9.11.

Hyper 0.9.11 depends on num_cpus 1.1.0. To avoid different version of num_cpus. We have updated rayon version from 0.4.0 to 0.4.3. Cargo.toml of util, style, geckolib, stylo component has been updated to use num_cpus version 1.1.0 instead of 0.2.2.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ X] `./mach build -d` does not report any errors
- [ X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

…igin

Referer policy strict-origin and strict-origin-when-cross-origin changes have been implemented. Relevant unit test cases have been added. Enum for RefererPolicy has been added to hyper codebase and v 0.9.11 of hyper contains these changes.

This commit also contains changes related to upgrade of hyper from v0.9.10 to v0.9.11. Other dependencies changed are rayon, utils, num_cpus.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14059)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-11-07 04:37:35 -06:00 committed by GitHub
commit dd34b2a335
54 changed files with 244 additions and 256 deletions

View file

@ -437,6 +437,23 @@ fn no_referrer_when_downgrade_header(referrer_url: Url, url: Url) -> Option<Url>
return strip_url(referrer_url, false);
}
/// https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-strict-origin
fn strict_origin(referrer_url: Url, url: Url) -> Option<Url> {
if referrer_url.scheme() == "https" && url.scheme() != "https" {
return None;
}
strip_url(referrer_url, true)
}
/// https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-strict-origin-when-cross-origin
fn strict_origin_when_cross_origin(referrer_url: Url, url: Url) -> Option<Url> {
if referrer_url.scheme() == "https" && url.scheme() != "https" {
return None;
}
let cross_origin = referrer_url.origin() != url.origin();
strip_url(referrer_url, cross_origin)
}
/// https://w3c.github.io/webappsec-referrer-policy/#strip-url
fn strip_url(mut referrer_url: Url, origin_only: bool) -> Option<Url> {
if referrer_url.scheme() == "https" || referrer_url.scheme() == "http" {
@ -467,6 +484,8 @@ pub fn determine_request_referrer(headers: &mut Headers,
Some(ReferrerPolicy::SameOrigin) => if cross_origin { None } else { strip_url(ref_url, false) },
Some(ReferrerPolicy::UnsafeUrl) => strip_url(ref_url, false),
Some(ReferrerPolicy::OriginWhenCrossOrigin) => strip_url(ref_url, cross_origin),
Some(ReferrerPolicy::StrictOrigin) => strict_origin(ref_url, url),
Some(ReferrerPolicy::StrictOriginWhenCrossOrigin) => strict_origin_when_cross_origin(ref_url, url),
Some(ReferrerPolicy::NoReferrerWhenDowngrade) | None =>
no_referrer_when_downgrade_header(ref_url, url),
};

View file

@ -125,6 +125,10 @@ pub enum ReferrerPolicy {
OriginWhenCrossOrigin,
/// "unsafe-url"
UnsafeUrl,
/// "strict-origin"
StrictOrigin,
/// "strict-origin-when-cross-origin"
StrictOriginWhenCrossOrigin,
}
#[derive(Clone, Deserialize, Serialize, HeapSizeOf)]

View file

@ -3006,6 +3006,8 @@ pub fn determine_policy_for_token(token: &str) -> Option<ReferrerPolicy> {
"default" | "no-referrer-when-downgrade" => Some(ReferrerPolicy::NoReferrerWhenDowngrade),
"origin" => Some(ReferrerPolicy::Origin),
"same-origin" => Some(ReferrerPolicy::SameOrigin),
"strict-origin" => Some(ReferrerPolicy::StrictOrigin),
"strict-origin-when-cross-origin" => Some(ReferrerPolicy::StrictOriginWhenCrossOrigin),
"origin-when-cross-origin" => Some(ReferrerPolicy::OriginWhenCrossOrigin),
"always" | "unsafe-url" => Some(ReferrerPolicy::UnsafeUrl),
"" => Some(ReferrerPolicy::NoReferrer),

View file

@ -822,6 +822,9 @@ impl Into<MsgReferrerPolicy> for ReferrerPolicy {
ReferrerPolicy::Origin => MsgReferrerPolicy::Origin,
ReferrerPolicy::Origin_when_cross_origin => MsgReferrerPolicy::OriginWhenCrossOrigin,
ReferrerPolicy::Unsafe_url => MsgReferrerPolicy::UnsafeUrl,
ReferrerPolicy::Strict_origin => MsgReferrerPolicy::StrictOrigin,
ReferrerPolicy::Strict_origin_when_cross_origin =>
MsgReferrerPolicy::StrictOriginWhenCrossOrigin,
}
}
}
@ -836,6 +839,9 @@ impl Into<ReferrerPolicy> for MsgReferrerPolicy {
MsgReferrerPolicy::SameOrigin => ReferrerPolicy::Origin,
MsgReferrerPolicy::OriginWhenCrossOrigin => ReferrerPolicy::Origin_when_cross_origin,
MsgReferrerPolicy::UnsafeUrl => ReferrerPolicy::Unsafe_url,
MsgReferrerPolicy::StrictOrigin => ReferrerPolicy::Strict_origin,
MsgReferrerPolicy::StrictOriginWhenCrossOrigin =>
ReferrerPolicy::Strict_origin_when_cross_origin,
}
}
}

View file

@ -104,5 +104,7 @@ enum ReferrerPolicy {
"no-referrer-when-downgrade",
"origin",
"origin-when-cross-origin",
"unsafe-url"
"unsafe-url",
"strict-origin",
"strict-origin-when-cross-origin"
};

View file

@ -1766,6 +1766,10 @@ impl ScriptThread {
ReferrerPolicy::OriginWhenCrossOrigin,
ReferrerPolicyHeader::UnsafeUrl =>
ReferrerPolicy::UnsafeUrl,
ReferrerPolicyHeader::StrictOrigin =>
ReferrerPolicy::StrictOrigin,
ReferrerPolicyHeader::StrictOriginWhenCrossOrigin =>
ReferrerPolicy::StrictOriginWhenCrossOrigin,
})
} else {
None

View file

@ -537,7 +537,7 @@ version = "0.0.1"
dependencies = [
"devtools_traits 0.0.1",
"encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -557,7 +557,7 @@ dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
@ -1034,7 +1034,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "hyper"
version = "0.9.10"
version = "0.9.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1042,7 +1042,7 @@ dependencies = [
"language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"mime 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-verify 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1060,7 +1060,7 @@ version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"mime 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1143,7 +1143,7 @@ version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -1463,7 +1463,7 @@ dependencies = [
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"devtools_traits 0.0.1",
"flate2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"immeta 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1512,7 +1512,7 @@ dependencies = [
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"devtools_traits 0.0.1",
"flate2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
@ -1533,7 +1533,7 @@ dependencies = [
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1621,7 +1621,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "num_cpus"
version = "0.2.13"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1942,11 +1942,12 @@ dependencies = [
[[package]]
name = "rayon"
version = "0.4.0"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -2018,7 +2019,7 @@ dependencies = [
"heapsize_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2112,7 +2113,7 @@ dependencies = [
"gfx_traits 0.0.1",
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2378,7 +2379,7 @@ dependencies = [
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ordered-float 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"owning_ref 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2642,7 +2643,7 @@ dependencies = [
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2739,7 +2740,7 @@ version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.1.76 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2752,7 +2753,7 @@ version = "0.0.1"
dependencies = [
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2788,7 +2789,7 @@ dependencies = [
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"offscreen_gl_context 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_traits 0.8.0 (git+https://github.com/servo/webrender)",
]
@ -2817,7 +2818,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"net2 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2982,7 +2983,7 @@ dependencies = [
"checksum html5ever 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6a2e00f17a864dfee00d41b46fda2a669e10e96bf71f8c712b3c88f4977188d7"
"checksum html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "daefa106438c66af58309c84842b5db1df2733fe35849f39adde6fdf63583d40"
"checksum httparse 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "46534074dbb80b070d60a5cb8ecadd8963a00a438ae1a95268850a7ef73b67ae"
"checksum hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)" = "eb27e8a3e8f17ac43ffa41bbda9cf5ad3f9f13ef66fa4873409d4902310275f7"
"checksum hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)" = "edd47c66782933e546a32ae89ca3c49263b2ba9bc29f3a0d5c52fff48e0ac67c"
"checksum hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "572d2168173019de312a050a24f2ad33ac2ac7895a2139fbf21ee6b6f470a24e"
"checksum idna 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1053236e00ce4f668aeca4a769a09b3bf5a682d802abd6f3cb39374f6b162c11"
"checksum image 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)" = "559d5ebbe9ec73111799e49c07717944b244f8accf5de33a8a8128bc3ecd2e00"
@ -3025,7 +3026,7 @@ dependencies = [
"checksum num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "287a1c9969a847055e1122ec0ea7a5c5d6f72aad97934e131c83d5c08ab4e45c"
"checksum num-rational 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "54ff603b8334a72fbb27fe66948aac0abaaa40231b3cecd189e76162f6f38aaf"
"checksum num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "8359ea48994f253fa958b5b90b013728b06f54872e5a58bce39540fcdd0f2527"
"checksum num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "cee7e88156f3f9e19bdd598f8d6c9db7bf4078f99f8381f43a55b09648d1a6e3"
"checksum num_cpus 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8890e6084723d57d0df8d2720b0d60c6ee67d6c93e7169630e4371e88765dcad"
"checksum objc 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7c9311aa5acd7bee14476afa0f0557f564e9d0d61218a8b833d9b1f871fa5fba"
"checksum odds 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)" = "f3701cfdec1676e319ad37ff96c31de39df8c92006032976153366f52693bf40"
"checksum offscreen_gl_context 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "000307b66855b01357765d9ac8d32a66aa09f3dcc3a7ccb272f74c76df475c9c"
@ -3054,7 +3055,7 @@ dependencies = [
"checksum quickersort 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e952ea7699262481636004bc4ab8afaccf2bc13f91b79d1aee6617bd8fc39651"
"checksum quote 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1e0c9bc6bfb0a60d539aab6e338207c1a5456e62f5bd5375132cee119aa4b3"
"checksum rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "2791d88c6defac799c3f20d74f094ca33b9332612d9aef9078519c82e4fe04a5"
"checksum rayon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8e501871917624668fe601ad12a730450414f9b0b64722a898b040ce3ae1b0fa"
"checksum rayon 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0f0783f5880c56f5a308e219ac9309dbe781e064741dd5def4c617c440890305"
"checksum ref_slice 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "546bb4aa91c85f232732cc5b3c8097ea97ae9a77304f9ab4df8b203ff7672dad"
"checksum regex 0.1.76 (registry+https://github.com/rust-lang/crates.io-index)" = "63b49f873f36ddc838d773972511e5fed2ef7350885af07d58e2f48ce8073dcd"
"checksum regex-syntax 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279401017ae31cf4e15344aa3f085d0e2e5c1e70067289ef906906fdbe92c8fd"

View file

@ -39,7 +39,7 @@ matches = "0.1"
nsstring_vendor = {path = "gecko_bindings/nsstring_vendor", optional = true}
num-integer = "0.1.32"
num-traits = "0.1.32"
num_cpus = "0.2.2"
num_cpus = "1.1.0"
ordered-float = "0.2.2"
owning_ref = "0.2.2"
parking_lot = "0.3.3"

View file

@ -22,7 +22,7 @@ getopts = "0.2.11"
heapsize = "0.3.0"
lazy_static = "0.2"
log = "0.3.5"
num_cpus = "0.2.2"
num_cpus = "1.1.0"
rustc-serialize = "0.3"
serde = {version = "0.8", optional = true}
serde_derive = {version = "0.8", optional = true}

45
ports/cef/Cargo.lock generated
View file

@ -492,7 +492,7 @@ version = "0.0.1"
dependencies = [
"devtools_traits 0.0.1",
"encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -512,7 +512,7 @@ dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
@ -939,7 +939,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "hyper"
version = "0.9.10"
version = "0.9.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
@ -947,7 +947,7 @@ dependencies = [
"language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"mime 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-verify 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
@ -965,7 +965,7 @@ version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"mime 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1048,7 +1048,7 @@ version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -1361,7 +1361,7 @@ dependencies = [
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"devtools_traits 0.0.1",
"flate2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"immeta 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1409,7 +1409,7 @@ dependencies = [
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1490,7 +1490,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "num_cpus"
version = "0.2.13"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1791,11 +1791,12 @@ dependencies = [
[[package]]
name = "rayon"
version = "0.4.0"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1867,7 +1868,7 @@ dependencies = [
"heapsize_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1951,7 +1952,7 @@ dependencies = [
"gfx_traits 0.0.1",
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2262,7 +2263,7 @@ dependencies = [
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ordered-float 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"owning_ref 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2507,7 +2508,7 @@ dependencies = [
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2597,7 +2598,7 @@ version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.1.76 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2610,7 +2611,7 @@ version = "0.0.1"
dependencies = [
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2646,7 +2647,7 @@ dependencies = [
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"offscreen_gl_context 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_traits 0.8.0 (git+https://github.com/servo/webrender)",
]
@ -2675,7 +2676,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"net2 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2834,7 +2835,7 @@ dependencies = [
"checksum html5ever 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6a2e00f17a864dfee00d41b46fda2a669e10e96bf71f8c712b3c88f4977188d7"
"checksum html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "daefa106438c66af58309c84842b5db1df2733fe35849f39adde6fdf63583d40"
"checksum httparse 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "46534074dbb80b070d60a5cb8ecadd8963a00a438ae1a95268850a7ef73b67ae"
"checksum hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)" = "eb27e8a3e8f17ac43ffa41bbda9cf5ad3f9f13ef66fa4873409d4902310275f7"
"checksum hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)" = "edd47c66782933e546a32ae89ca3c49263b2ba9bc29f3a0d5c52fff48e0ac67c"
"checksum hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "572d2168173019de312a050a24f2ad33ac2ac7895a2139fbf21ee6b6f470a24e"
"checksum idna 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1053236e00ce4f668aeca4a769a09b3bf5a682d802abd6f3cb39374f6b162c11"
"checksum image 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)" = "559d5ebbe9ec73111799e49c07717944b244f8accf5de33a8a8128bc3ecd2e00"
@ -2877,7 +2878,7 @@ dependencies = [
"checksum num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "287a1c9969a847055e1122ec0ea7a5c5d6f72aad97934e131c83d5c08ab4e45c"
"checksum num-rational 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "54ff603b8334a72fbb27fe66948aac0abaaa40231b3cecd189e76162f6f38aaf"
"checksum num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "8359ea48994f253fa958b5b90b013728b06f54872e5a58bce39540fcdd0f2527"
"checksum num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "cee7e88156f3f9e19bdd598f8d6c9db7bf4078f99f8381f43a55b09648d1a6e3"
"checksum num_cpus 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8890e6084723d57d0df8d2720b0d60c6ee67d6c93e7169630e4371e88765dcad"
"checksum objc 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7c9311aa5acd7bee14476afa0f0557f564e9d0d61218a8b833d9b1f871fa5fba"
"checksum odds 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)" = "f3701cfdec1676e319ad37ff96c31de39df8c92006032976153366f52693bf40"
"checksum offscreen_gl_context 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "000307b66855b01357765d9ac8d32a66aa09f3dcc3a7ccb272f74c76df475c9c"
@ -2906,7 +2907,7 @@ dependencies = [
"checksum quickersort 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e952ea7699262481636004bc4ab8afaccf2bc13f91b79d1aee6617bd8fc39651"
"checksum quote 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1e0c9bc6bfb0a60d539aab6e338207c1a5456e62f5bd5375132cee119aa4b3"
"checksum rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "2791d88c6defac799c3f20d74f094ca33b9332612d9aef9078519c82e4fe04a5"
"checksum rayon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8e501871917624668fe601ad12a730450414f9b0b64722a898b040ce3ae1b0fa"
"checksum rayon 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0f0783f5880c56f5a308e219ac9309dbe781e064741dd5def4c617c440890305"
"checksum ref_slice 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "546bb4aa91c85f232732cc5b3c8097ea97ae9a77304f9ab4df8b203ff7672dad"
"checksum regex 0.1.76 (registry+https://github.com/rust-lang/crates.io-index)" = "63b49f873f36ddc838d773972511e5fed2ef7350885af07d58e2f48ce8073dcd"
"checksum regex-syntax 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279401017ae31cf4e15344aa3f085d0e2e5c1e70067289ef906906fdbe92c8fd"

View file

@ -9,7 +9,7 @@ dependencies = [
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"selectors 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
"style 0.0.1",
@ -226,7 +226,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "num_cpus"
version = "0.2.13"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
@ -348,7 +348,7 @@ dependencies = [
"nsstring_vendor 0.1.0",
"num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ordered-float 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"owning_ref 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
@ -388,7 +388,7 @@ dependencies = [
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"selectors 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
"style 0.0.1",
@ -474,7 +474,7 @@ dependencies = [
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"xdg 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -537,7 +537,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20"
"checksum num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "fb24d9bfb3f222010df27995441ded1e954f8f69cd35021f6bef02ca9552fb92"
"checksum num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "8359ea48994f253fa958b5b90b013728b06f54872e5a58bce39540fcdd0f2527"
"checksum num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "cee7e88156f3f9e19bdd598f8d6c9db7bf4078f99f8381f43a55b09648d1a6e3"
"checksum num_cpus 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8890e6084723d57d0df8d2720b0d60c6ee67d6c93e7169630e4371e88765dcad"
"checksum ordered-float 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cc511538298611a79d5a4ddfbb75315b866d942ed26a00bdc3590795c68b7279"
"checksum owning_ref 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8d91377085359426407a287ab16884a0111ba473aa6844ff01d4ec20ce3d75e7"
"checksum parking_lot 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3562f3de7bdff194212be82366abf5c6565aff8a433b71c53c63d0e7c9913878"

View file

@ -17,7 +17,7 @@ euclid = "0.10.1"
lazy_static = "0.2"
libc = "0.2"
log = {version = "0.3.5", features = ["release_max_level_info"]}
num_cpus = "0.2.2"
num_cpus = "1.1.0"
parking_lot = "0.3"
selectors = "0.14"
style = {path = "../../components/style", features = ["gecko"]}

View file

@ -1767,6 +1767,155 @@ fn test_http_to_https_considered_cross_origin_for_referrer_header_logic() {
assert_referrer_header_matches(&origin_info, request_url, expected_referrer);
}
#[test]
fn test_referrer_with_strictorigin_policy_http_to_https() {
let request_url = "https://mozilla.com";
let referrer_url = "http://mozilla.com";
let referrer_policy = Some(ReferrerPolicy::StrictOrigin);
let expected_referrer = "http://mozilla.com/";
let origin_info = LoadOriginInfo {
referrer_url: referrer_url,
referrer_policy: referrer_policy
};
assert_referrer_header_matches(&origin_info, request_url, expected_referrer);
}
#[test]
fn test_no_referrer_with_strictorigin_policy_https_to_http() {
let request_url = "http://mozilla.com";
let referrer_url = "https://mozilla.com/some/path";
let referrer_policy = Some(ReferrerPolicy::StrictOrigin);
let origin_info = LoadOriginInfo {
referrer_url: referrer_url,
referrer_policy: referrer_policy
};
assert_referrer_header_not_included(&origin_info, request_url);
}
#[test]
fn test_referrer_with_strictorigin_policy_http_to_http() {
let request_url = "http://mozilla.com/";
let referrer_url = "http://mozilla.com/some/path";
let referrer_policy = Some(ReferrerPolicy::StrictOrigin);
let expected_referrer = "http://mozilla.com/";
let origin_info = LoadOriginInfo {
referrer_url: referrer_url,
referrer_policy: referrer_policy
};
assert_referrer_header_matches(&origin_info, request_url, expected_referrer);
}
#[test]
fn test_referrer_with_strictorigin_policy_https_to_https() {
let request_url = "https://mozilla.com/";
let referrer_url = "https://mozilla.com/some/path";
let referrer_policy = Some(ReferrerPolicy::StrictOrigin);
let expected_referrer = "https://mozilla.com/";
let origin_info = LoadOriginInfo {
referrer_url: referrer_url,
referrer_policy: referrer_policy
};
assert_referrer_header_matches(&origin_info, request_url, expected_referrer);
}
#[test]
fn test_referrer_with_strictoriginwhencrossorigin_policy_https_to_https_same_origin() {
let request_url = "https://mozilla.com";
let referrer_url = "https://mozilla.com/some/path";
let referrer_policy = Some(ReferrerPolicy::StrictOriginWhenCrossOrigin);
let expected_referrer = "https://mozilla.com/some/path";
let origin_info = LoadOriginInfo {
referrer_url: referrer_url,
referrer_policy: referrer_policy
};
assert_referrer_header_matches(&origin_info, request_url, expected_referrer);
}
#[test]
fn test_referrer_with_strictoriginwhencrossorigin_policy_https_to_https_cross_origin() {
let request_url = "https://servo.mozilla.com";
let referrer_url = "https://mozilla.com/some/path";
let referrer_policy = Some(ReferrerPolicy::StrictOriginWhenCrossOrigin);
let expected_referrer = "https://mozilla.com/";
let origin_info = LoadOriginInfo {
referrer_url: referrer_url,
referrer_policy: referrer_policy
};
assert_referrer_header_matches(&origin_info, request_url, expected_referrer);
}
#[test]
fn test_referrer_set_with_strictoriginwhencrossorigin_policy_http_to_http_cross_orig() {
let request_url = "http://servo.mozilla.com";
let referrer_url = "http://mozilla.com/some/path";
let referrer_policy = Some(ReferrerPolicy::StrictOriginWhenCrossOrigin);
let expected_referrer = "http://mozilla.com/";
let origin_info = LoadOriginInfo {
referrer_url: referrer_url,
referrer_policy: referrer_policy
};
assert_referrer_header_matches(&origin_info, request_url, expected_referrer);
}
#[test]
fn test_referrer_set_with_strictoriginwhencrossorigin_policy_http_to_http_same_orig() {
let request_url = "http://mozilla.com";
let referrer_url = "http://mozilla.com/some/path";
let referrer_policy = Some(ReferrerPolicy::StrictOriginWhenCrossOrigin);
let expected_referrer = "http://mozilla.com/some/path";
let origin_info = LoadOriginInfo {
referrer_url: referrer_url,
referrer_policy: referrer_policy
};
assert_referrer_header_matches(&origin_info, request_url, expected_referrer);
}
#[test]
fn test_referrer_set_with_strictoriginwhencrossorigin_policy_http_to_https_cross_orig() {
let request_url = "https://servo.mozilla.com";
let referrer_url = "http://mozilla.com/some/path";
let referrer_policy = Some(ReferrerPolicy::StrictOriginWhenCrossOrigin);
let expected_referrer = "http://mozilla.com/";
let origin_info = LoadOriginInfo {
referrer_url: referrer_url,
referrer_policy: referrer_policy
};
assert_referrer_header_matches(&origin_info, request_url, expected_referrer);
}
#[test]
fn test_referrer_set_with_strictoriginwhencrossorigin_policy_http_to_https_same_orig() {
let request_url = "https://mozilla.com";
let referrer_url = "http://mozilla.com/some/path";
let referrer_policy = Some(ReferrerPolicy::StrictOriginWhenCrossOrigin);
let expected_referrer = "http://mozilla.com/";
let origin_info = LoadOriginInfo {
referrer_url: referrer_url,
referrer_policy: referrer_policy
};
assert_referrer_header_matches(&origin_info, request_url, expected_referrer);
}
#[test]
fn test_referrer_set_to_ref_url_with_noreferrerwhendowngrade_policy_https_to_https() {
let request_url = "https://mozilla.com";

View file

@ -19,7 +19,7 @@ euclid = "0.10.1"
lazy_static = "0.2"
libc = "0.2"
log = {version = "0.3.5", features = ["release_max_level_info"]}
num_cpus = "0.2.2"
num_cpus = "1.1.0"
parking_lot = "0.3"
selectors = "0.14"
url = "1.2"

View file

@ -1,5 +0,0 @@
[cross-insecure.keep-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via script-tag using the http-rp\n delivery method with keep-origin-redirect and when\n the target request is cross-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[cross-insecure.no-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via script-tag using the http-rp\n delivery method with no-redirect and when\n the target request is cross-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[cross-insecure.swap-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via script-tag using the http-rp\n delivery method with swap-origin-redirect and when\n the target request is cross-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[cross-insecure.keep-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via xhr-request using the http-rp\n delivery method with keep-origin-redirect and when\n the target request is cross-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[cross-insecure.no-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via xhr-request using the http-rp\n delivery method with no-redirect and when\n the target request is cross-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[cross-insecure.swap-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via xhr-request using the http-rp\n delivery method with swap-origin-redirect and when\n the target request is cross-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[same-insecure.swap-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via script-tag using the http-rp\n delivery method with swap-origin-redirect and when\n the target request is same-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[same-insecure.swap-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via xhr-request using the http-rp\n delivery method with swap-origin-redirect and when\n the target request is same-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[cross-insecure.keep-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via script-tag using the meta-referrer\n delivery method with keep-origin-redirect and when\n the target request is cross-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[cross-insecure.no-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via script-tag using the meta-referrer\n delivery method with no-redirect and when\n the target request is cross-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[cross-insecure.swap-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via script-tag using the meta-referrer\n delivery method with swap-origin-redirect and when\n the target request is cross-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[cross-insecure.keep-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via xhr-request using the meta-referrer\n delivery method with keep-origin-redirect and when\n the target request is cross-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[cross-insecure.no-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via xhr-request using the meta-referrer\n delivery method with no-redirect and when\n the target request is cross-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[cross-insecure.swap-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via xhr-request using the meta-referrer\n delivery method with swap-origin-redirect and when\n the target request is cross-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[same-insecure.swap-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via script-tag using the meta-referrer\n delivery method with swap-origin-redirect and when\n the target request is same-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[same-insecure.swap-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via xhr-request using the meta-referrer\n delivery method with swap-origin-redirect and when\n the target request is same-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[insecure-protocol.keep-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via script-tag using the http-rp\n delivery method with keep-origin-redirect and when\n the target request is cross-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[insecure-protocol.no-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via script-tag using the http-rp\n delivery method with no-redirect and when\n the target request is cross-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[insecure-protocol.swap-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via script-tag using the http-rp\n delivery method with swap-origin-redirect and when\n the target request is cross-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[insecure-protocol.keep-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via xhr-request using the http-rp\n delivery method with keep-origin-redirect and when\n the target request is cross-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[insecure-protocol.no-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via xhr-request using the http-rp\n delivery method with no-redirect and when\n the target request is cross-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[insecure-protocol.swap-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via xhr-request using the http-rp\n delivery method with swap-origin-redirect and when\n the target request is cross-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[insecure-protocol.keep-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via script-tag using the http-rp\n delivery method with keep-origin-redirect and when\n the target request is same-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[insecure-protocol.no-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via script-tag using the http-rp\n delivery method with no-redirect and when\n the target request is same-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[insecure-protocol.swap-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via script-tag using the http-rp\n delivery method with swap-origin-redirect and when\n the target request is same-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[insecure-protocol.keep-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via xhr-request using the http-rp\n delivery method with keep-origin-redirect and when\n the target request is same-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[insecure-protocol.no-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via xhr-request using the http-rp\n delivery method with no-redirect and when\n the target request is same-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[insecure-protocol.swap-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via xhr-request using the http-rp\n delivery method with swap-origin-redirect and when\n the target request is same-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[insecure-protocol.keep-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via script-tag using the meta-referrer\n delivery method with keep-origin-redirect and when\n the target request is cross-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[insecure-protocol.no-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via script-tag using the meta-referrer\n delivery method with no-redirect and when\n the target request is cross-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[insecure-protocol.swap-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via script-tag using the meta-referrer\n delivery method with swap-origin-redirect and when\n the target request is cross-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[insecure-protocol.keep-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via xhr-request using the meta-referrer\n delivery method with keep-origin-redirect and when\n the target request is cross-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[insecure-protocol.no-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via xhr-request using the meta-referrer\n delivery method with no-redirect and when\n the target request is cross-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[insecure-protocol.swap-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via xhr-request using the meta-referrer\n delivery method with swap-origin-redirect and when\n the target request is cross-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[insecure-protocol.keep-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via script-tag using the meta-referrer\n delivery method with keep-origin-redirect and when\n the target request is same-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[insecure-protocol.no-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via script-tag using the meta-referrer\n delivery method with no-redirect and when\n the target request is same-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[insecure-protocol.swap-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via script-tag using the meta-referrer\n delivery method with swap-origin-redirect and when\n the target request is same-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[insecure-protocol.keep-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via xhr-request using the meta-referrer\n delivery method with keep-origin-redirect and when\n the target request is same-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[insecure-protocol.no-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via xhr-request using the meta-referrer\n delivery method with no-redirect and when\n the target request is same-origin.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[insecure-protocol.swap-origin-redirect.http.html]
type: testharness
[The referrer URL is origin when a\n document served over http requires an http\n sub-resource via xhr-request using the meta-referrer\n delivery method with swap-origin-redirect and when\n the target request is same-origin.]
expected: FAIL