Use get_mut instead of get-remove-set in XHR send()

This commit is contained in:
Darin Minamoto 2016-06-27 21:31:28 -07:00
parent 00af25b685
commit fc6e20f652
11 changed files with 30 additions and 34 deletions

View file

@ -10,7 +10,7 @@ path = "lib.rs"
[dependencies]
devtools_traits = {path = "../devtools_traits"}
hyper = { version = "0.9", features = [ "serde-serialization" ] }
hyper = { version = "0.9.9", features = [ "serde-serialization" ] }
ipc-channel = {git = "https://github.com/servo/ipc-channel"}
log = "0.3.5"
msg = {path = "../msg"}

View file

@ -12,7 +12,7 @@ path = "lib.rs"
bitflags = "0.7"
heapsize = "0.3.0"
heapsize_plugin = "0.1.2"
hyper = {version = "0.9", features = ["serde-serialization"]}
hyper = {version = "0.9.9", features = ["serde-serialization"]}
ipc-channel = {git = "https://github.com/servo/ipc-channel"}
msg = {path = "../msg"}
serde = "0.7.11"

View file

@ -15,7 +15,7 @@ cssparser = {version = "0.5.4", features = ["heap_size", "serde-serialization"]}
euclid = "0.7.1"
heapsize = "0.3.0"
heapsize_plugin = "0.1.2"
hyper = {version = "0.9", features = ["serde-serialization"]}
hyper = {version = "0.9.9", features = ["serde-serialization"]}
ipc-channel = {git = "https://github.com/servo/ipc-channel"}
layers = {git = "https://github.com/servo/rust-layers", features = ["plugins"]}
plugins = {path = "../plugins"}

View file

@ -16,7 +16,7 @@ cookie = { version = "0.2.5", features = ["serialize-serde", "serialize-rustc" ]
device = {git = "https://github.com/servo/devices"}
devtools_traits = {path = "../devtools_traits"}
flate2 = "0.2.0"
hyper = {version = "0.9", features = ["serde-serialization"]}
hyper = {version = "0.9.9", features = ["serde-serialization"]}
immeta = "0.3.1"
ipc-channel = {git = "https://github.com/servo/ipc-channel"}
lazy_static = "0.2"

View file

@ -14,7 +14,7 @@ msg = {path = "../msg"}
ipc-channel = {git = "https://github.com/servo/ipc-channel"}
heapsize = "0.3.0"
heapsize_plugin = "0.1.2"
hyper = { version = "0.9", features = [ "serde-serialization" ] }
hyper = { version = "0.9.9", features = [ "serde-serialization" ] }
image = "0.10"
lazy_static = "0.2"
log = "0.3.5"

View file

@ -32,7 +32,7 @@ gfx_traits = {path = "../gfx_traits"}
heapsize = "0.3.6"
heapsize_plugin = "0.1.2"
html5ever = {version = "0.5.1", features = ["heap_size", "unstable"]}
hyper = {version = "0.9", features = ["serde-serialization"]}
hyper = {version = "0.9.9", features = ["serde-serialization"]}
image = "0.10"
ipc-channel = {git = "https://github.com/servo/ipc-channel"}
js = {git = "https://github.com/servo/rust-mozjs"}

View file

@ -635,7 +635,7 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
}
if !content_type_set {
let ct = request.headers.get::<ContentType>().map(|x| x.clone());
let ct = request.headers.get_mut::<ContentType>();
if let Some(mut ct) = ct {
if let Some(encoding) = encoding {
for param in &mut (ct.0).2 {
@ -646,10 +646,6 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
}
}
}
// remove instead of mutate in place
// https://github.com/hyperium/hyper/issues/821
request.headers.remove_raw("content-type");
request.headers.set(ct);
}
}

View file

@ -501,7 +501,7 @@ name = "devtools"
version = "0.0.1"
dependencies = [
"devtools_traits 0.0.1",
"hyper 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
@ -520,7 +520,7 @@ dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)",
"msg 0.0.1",
"serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
@ -973,7 +973,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "hyper"
version = "0.9.6"
version = "0.9.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1374,7 +1374,7 @@ dependencies = [
"euclid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)",
"layers 0.2.6 (git+https://github.com/servo/rust-layers)",
"plugins 0.0.1",
@ -1397,7 +1397,7 @@ dependencies = [
"device 0.0.1 (git+https://github.com/servo/devices)",
"devtools_traits 0.0.1",
"flate2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.9 (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.2.3 (git+https://github.com/servo/ipc-channel)",
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1444,7 +1444,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.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)",
"msg 0.0.1",
"net 0.0.1",
@ -1464,7 +1464,7 @@ dependencies = [
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)",
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1913,7 +1913,7 @@ dependencies = [
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)",
"js 0.1.3 (git+https://github.com/servo/rust-mozjs)",
@ -2555,7 +2555,7 @@ name = "webdriver"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"hyper 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.9 (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.71 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2567,7 +2567,7 @@ version = "0.0.1"
dependencies = [
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2629,7 +2629,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.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
"net2 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",

View file

@ -10,7 +10,7 @@ path = "lib.rs"
[dependencies]
euclid = "0.7.1"
hyper = "0.9"
hyper = "0.9.9"
image = "0.10"
ipc-channel = {git = "https://github.com/servo/ipc-channel"}
log = "0.3.5"

20
ports/cef/Cargo.lock generated
View file

@ -460,7 +460,7 @@ name = "devtools"
version = "0.0.1"
dependencies = [
"devtools_traits 0.0.1",
"hyper 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
@ -479,7 +479,7 @@ dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)",
"msg 0.0.1",
"serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
@ -882,7 +882,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "hyper"
version = "0.9.6"
version = "0.9.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1276,7 +1276,7 @@ dependencies = [
"euclid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)",
"layers 0.2.6 (git+https://github.com/servo/rust-layers)",
"plugins 0.0.1",
@ -1299,7 +1299,7 @@ dependencies = [
"device 0.0.1 (git+https://github.com/servo/devices)",
"devtools_traits 0.0.1",
"flate2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.9 (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.2.3 (git+https://github.com/servo/ipc-channel)",
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1345,7 +1345,7 @@ dependencies = [
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)",
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1767,7 +1767,7 @@ dependencies = [
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)",
"js 0.1.3 (git+https://github.com/servo/rust-mozjs)",
@ -2417,7 +2417,7 @@ name = "webdriver"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"hyper 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.9 (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.71 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2429,7 +2429,7 @@ version = "0.0.1"
dependencies = [
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2491,7 +2491,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.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
"net2 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",

View file

@ -13,7 +13,7 @@ content-blocker = "0.2"
cookie = "0.2"
devtools_traits = {path = "../../../components/devtools_traits"}
flate2 = "0.2.0"
hyper = "0.9"
hyper = "0.9.9"
ipc-channel = {git = "https://github.com/servo/ipc-channel"}
msg = {path = "../../../components/msg"}
net = {path = "../../../components/net"}