fix SetStatusCodeAndDisposeAsync(HttpStatusCode.NotModified) breaking
This commit is contained in:
@@ -52,8 +52,10 @@ public class RequestContext : IDisposable {
|
||||
public async Task SetStatusCodeAndDisposeAsync(HttpStatusCode status) {
|
||||
using (this) {
|
||||
SetStatusCode((int) status);
|
||||
await WriteToRespAsync("\n\n");
|
||||
await RespWriter.FlushAsync();
|
||||
if (status != HttpStatusCode.NotModified) { // NotModified must not write any data to response
|
||||
await WriteToRespAsync("\n\n");
|
||||
await RespWriter.FlushAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user