Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Response's `Clone()` method to clone headers. #13882

Merged
merged 1 commit into from Oct 22, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Make Response's `Clone()` method to clone headers.

This patch allows the response clone to have the same headers list as
the original's. Previously, only the cloned response's headers guard was
set to be the same as the original response's headers guard.
  • Loading branch information
jeenalee committed Oct 21, 2016
commit 25cc87f226d330c77b63dafb4fd4ac23846854a8
@@ -5,7 +5,7 @@
use body::{BodyOperations, BodyType, consume_body, consume_body_with_promise};
use core::cell::Cell;
use dom::bindings::cell::DOMRefCell;
use dom::bindings::codegen::Bindings::HeadersBinding::HeadersMethods;
use dom::bindings::codegen::Bindings::HeadersBinding::{HeadersInit, HeadersMethods};
use dom::bindings::codegen::Bindings::ResponseBinding;
use dom::bindings::codegen::Bindings::ResponseBinding::{ResponseMethods, ResponseType as DOMResponseType};
use dom::bindings::codegen::Bindings::XMLHttpRequestBinding::BodyInit;
@@ -303,6 +303,7 @@ impl ResponseMethods for Response {
// Step 2
let new_response = Response::new(&self.global());
new_response.Headers().set_guard(self.Headers().get_guard());
try!(new_response.Headers().fill(Some(HeadersInit::Headers(self.Headers()))));

// https://fetch.spec.whatwg.org/#concept-response-clone
// Instead of storing a net_traits::Response internally, we
@@ -1,8 +1,5 @@
[response-clone.html]
type: testharness
[Check Response's clone has the expected attribute values]
expected: FAIL
[Check orginal response's body after cloning]
expected: FAIL
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.