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) {
|
public async Task SetStatusCodeAndDisposeAsync(HttpStatusCode status) {
|
||||||
using (this) {
|
using (this) {
|
||||||
SetStatusCode((int) status);
|
SetStatusCode((int) status);
|
||||||
await WriteToRespAsync("\n\n");
|
if (status != HttpStatusCode.NotModified) { // NotModified must not write any data to response
|
||||||
await RespWriter.FlushAsync();
|
await WriteToRespAsync("\n\n");
|
||||||
|
await RespWriter.FlushAsync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user