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