Bug 1217501 P5 Relax guard checking on Headers with existing headers. r=ehsan
authorBen Kelly <ben@wanderview.com>
Tue, 27 Oct 2015 09:23:34 -0700
changeset 305015 1829e3855b61178f8327bad8306961a2bdc403dc
parent 305014 1aabfb4e5bd4d5810df3a4a5872f76a20d749c3a
child 305016 8eb31a08c5b66fb68e949cb47857a124261fc742
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1217501
milestone44.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 1217501 P5 Relax guard checking on Headers with existing headers. r=ehsan
dom/fetch/InternalHeaders.cpp
--- a/dom/fetch/InternalHeaders.cpp
+++ b/dom/fetch/InternalHeaders.cpp
@@ -146,23 +146,18 @@ void
 InternalHeaders::Clear()
 {
   mList.Clear();
 }
 
 void
 InternalHeaders::SetGuard(HeadersGuardEnum aGuard, ErrorResult& aRv)
 {
-  // Rather than re-validate all current headers, just require code to set
-  // this prior to populating the InternalHeaders object.  Allow setting immutable
-  // late, though, as that is pretty much required to have a  useful, immutable
-  // headers object.
-  if (aGuard != HeadersGuardEnum::Immutable && mList.Length() > 0) {
-    aRv.Throw(NS_ERROR_FAILURE);
-  }
+  // The guard is only checked during ::Set() and ::Append() in the spec.  It
+  // does not require revalidating headers already set.
   mGuard = aGuard;
 }
 
 InternalHeaders::~InternalHeaders()
 {
 }
 
 // static