diff options
Diffstat (limited to 'dom/fetch')
-rw-r--r-- | dom/fetch/InternalHeaders.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/dom/fetch/InternalHeaders.cpp b/dom/fetch/InternalHeaders.cpp index 11585615ea..83a6867851 100644 --- a/dom/fetch/InternalHeaders.cpp +++ b/dom/fetch/InternalHeaders.cpp @@ -316,10 +316,11 @@ InternalHeaders::Fill(const Sequence<Sequence<nsCString>>& aInit, ErrorResult& a void InternalHeaders::Fill(const MozMap<nsCString>& aInit, ErrorResult& aRv) { - nsTArray<nsString> keys; - aInit.GetKeys(keys); - for (uint32_t i = 0; i < keys.Length() && !aRv.Failed(); ++i) { - Append(NS_ConvertUTF16toUTF8(keys[i]), aInit.Get(keys[i]), aRv); + for (auto& entry : aInit.Entries()) { + Append(NS_ConvertUTF16toUTF8(entry.mKey), entry.mValue, aRv); + if (aRv.Failed()) { + return; + } } } |