forked from aspnet/AspNetWebStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNonClosingDelegatingStream.cs
More file actions
27 lines (24 loc) · 1.04 KB
/
Copy pathNonClosingDelegatingStream.cs
File metadata and controls
27 lines (24 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.IO;
namespace System.Net.Http.Internal
{
/// <summary>
/// Stream that doesn't close the inner stream when closed. This is to work around a limitation
/// in the <see cref="System.Xml.XmlDictionaryReader"/> insisting of closing the inner stream.
/// The regular <see cref="System.Xml.XmlReader"/> does allow for not closing the inner stream but that
/// doesn't have the quota that we need for security reasons. Implementations of
/// <see cref="System.Net.Http.Formatting.MediaTypeFormatter"/>
/// should not close the input stream when reading or writing so hence this workaround.
/// </summary>
internal class NonClosingDelegatingStream : DelegatingStream
{
public NonClosingDelegatingStream(Stream innerStream)
: base(innerStream)
{
}
public override void Close()
{
}
}
}