Skip to content

Commit 6244275

Browse files
authored
Add method on HttpResponse to manually set the value of ResponseSent (#112)
Closes #102
1 parent 8474527 commit 6244275

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Grapevine/HttpResponse.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@ public HttpResponseBase(HttpListenerResponse response)
9898
Advanced = response;
9999
response.ContentEncoding = Encoding.UTF8;
100100
}
101+
102+
/// <summary>
103+
/// Use this method to manually set the ResponseSent property to true. Generally, the value of this property is set by the SendResponseAsync method. If, however, this method was bypassed and the Advanced property was used to directly access the output stream, then the ResponseSent property will need to be set here to avoid an exception being thrown later in the routing process.
104+
/// </summary>
105+
public virtual void MarkAsResponseSent()
106+
{
107+
ResponseSent = true;
108+
}
101109
}
102110

103111
public class HttpResponse : HttpResponseBase, IHttpResponse

0 commit comments

Comments
 (0)