fix SetStatusCodeAndDisposeAsync(HttpStatusCode.NotModified) breaking
This commit is contained in:
parent
d2a3a82b95
commit
6e640e1ced
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user