Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit d6bd148

Browse files
committed
Restore public surface.
1 parent f420369 commit d6bd148

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/System.Net.WebHeaderCollection/src/System/Net/WebHeaderCollection.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,11 @@ public override string[] AllKeys
593593
}
594594
}
595595

596+
IEnumerator IEnumerable.GetEnumerator()
597+
{
598+
return GetEnumerator();
599+
}
600+
596601
public override IEnumerator GetEnumerator()
597602
{
598603
return InnerCollection.Keys.GetEnumerator();

src/System.Net.WebHeaderCollection/tests/WebHeaderCollectionTest.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,5 +266,22 @@ public void IterateCollection_Success()
266266

267267
Assert.Equal("AcceptContent-Length", result);
268268
}
269+
270+
[Fact]
271+
public void IterateIEnumerable_Success()
272+
{
273+
WebHeaderCollection w = new WebHeaderCollection();
274+
w["Accept"] = "text/plain";
275+
w["Content-Length"] = "123";
276+
277+
string result = "";
278+
foreach (var item in (System.Collections.IEnumerable)w)
279+
{
280+
result += item;
281+
}
282+
283+
Assert.Equal("AcceptContent-Length", result);
284+
}
285+
269286
}
270287
}

0 commit comments

Comments
 (0)