| Index: third_party/WebKit/Source/modules/fetch/Headers.cpp
|
| diff --git a/third_party/WebKit/Source/modules/fetch/Headers.cpp b/third_party/WebKit/Source/modules/fetch/Headers.cpp
|
| index c420ef8c5cebc6ad83206e6ce22dda35e9a7c39a..5511d78362a530590bb7b522bc1a3f9e8511b2ac 100644
|
| --- a/third_party/WebKit/Source/modules/fetch/Headers.cpp
|
| +++ b/third_party/WebKit/Source/modules/fetch/Headers.cpp
|
| @@ -21,15 +21,18 @@ namespace {
|
| class HeadersIterationSource final
|
| : public PairIterable<String, String>::IterationSource {
|
| public:
|
| - explicit HeadersIterationSource(FetchHeaderList* headers)
|
| - : m_headers(headers), m_current(0) {}
|
| + explicit HeadersIterationSource(const FetchHeaderList* headers)
|
| + : m_headers(headers->clone()), m_current(0) {
|
| + m_headers->sortAndCombine();
|
| + }
|
|
|
| bool next(ScriptState* scriptState,
|
| String& key,
|
| String& value,
|
| ExceptionState& exception) override {
|
| - // FIXME: This simply advances an index and returns the next value if
|
| - // any, so if the iterated object is mutated values may be skipped.
|
| + // This simply advances an index and returns the next value if any; the
|
| + // iterated list is not exposed to script so it will never be mutated
|
| + // during iteration.
|
| if (m_current >= m_headers->size())
|
| return false;
|
|
|
|
|