fix SetStatusCodeAndDisposeAsync(HttpStatusCode.NotModified) breaking
This commit is contained in:
parent
d2a3a82b95
commit
4571b979fd
|
|
@ -44,19 +44,14 @@ public class RequestContext : IDisposable {
|
|||
public async Task SetStatusCodeAndDisposeAsync(int status) {
|
||||
using (this) {
|
||||
SetStatusCode(status);
|
||||
await WriteToRespAsync("\n\n");
|
||||
await RespWriter.FlushAsync();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task SetStatusCodeAndDisposeAsync(HttpStatusCode status) {
|
||||
using (this) {
|
||||
SetStatusCode((int) status);
|
||||
await WriteToRespAsync("\n\n");
|
||||
await RespWriter.FlushAsync();
|
||||
if (status != (int)HttpStatusCode.NotModified) { // NotModified must not write any data to response
|
||||
await WriteToRespAsync("\n\n");
|
||||
await RespWriter.FlushAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async Task SetStatusCodeAndDisposeAsync(HttpStatusCode status) => await SetStatusCodeAndDisposeAsync((int) status);
|
||||
|
||||
public async Task SetStatusCodeAndDisposeAsync(int status, string description) {
|
||||
using (this) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user