Bug 1074286 - Fix Headers::Fill(const Headers&, ErrorResult&). r=bkelly
authorNikhil Marathe <nsm.nikhil@gmail.com>
Mon, 29 Sep 2014 10:28:52 -0700
changeset 232315 1c766099a83cf10ef4423eefb7f6c49e64c23fb3
parent 232314 3b3954b323c68548093e89c72fb23b6aae99c6be
child 232316 3a2cf29a629f6631628a21780a291b2895a663ef
push id611
push userraliiev@mozilla.com
push dateMon, 05 Jan 2015 23:23:16 +0000
treeherdermozilla-release@345cd3b9c445 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbkelly
bugs1074286
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1074286 - Fix Headers::Fill(const Headers&, ErrorResult&). r=bkelly
dom/fetch/Headers.cpp
--- a/dom/fetch/Headers.cpp
+++ b/dom/fetch/Headers.cpp
@@ -292,19 +292,23 @@ Headers::IsForbiddenRequestNoCorsHeader(
 bool
 Headers::IsForbiddenResponseHeader(const nsACString& aName) const
 {
   return mGuard == HeadersGuardEnum::Response &&
          nsContentUtils::IsForbiddenResponseHeader(aName);
 }
 
 void
-Headers::Fill(const Headers& aInit, ErrorResult&)
+Headers::Fill(const Headers& aInit, ErrorResult& aRv)
 {
-  mList = aInit.mList;
+  const nsTArray<Entry>& list = aInit.mList;
+  for (uint32_t i = 0; i < list.Length() && !aRv.Failed(); ++i) {
+    const Entry& entry = list[i];
+    Append(entry.mName, entry.mValue, aRv);
+  }
 }
 
 void
 Headers::Fill(const Sequence<Sequence<nsCString>>& aInit, ErrorResult& aRv)
 {
   for (uint32_t i = 0; i < aInit.Length() && !aRv.Failed(); ++i) {
     const Sequence<nsCString>& tuple = aInit[i];
     if (tuple.Length() != 2) {