File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,8 @@ export class EmptyResponse<A> extends Response<A> {
1616 }
1717
1818 protected override async send ( res : http . ServerResponse , req ?: Request < A > ) : Promise < void > {
19- if ( req !== undefined )
20- req . _responseHeaders . set ( "content-length" , "0" ) ;
19+ if ( ! this . headers . has ( "content-length" ) )
20+ this . headers . set ( "content-length" , "0" ) ;
2121 this . writeHead ( res , req ) ;
2222 res . end ( ) ;
2323 }
Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ export class TextResponse<A> extends BufferResponse<A> {
1919 public constructor ( text : string , statusCode = 200 , headers ?: HeadersInit ) {
2020 super ( statusCode , headers ) ;
2121 this . text = text ;
22+ if ( ! this . headers . has ( "content-type" ) )
23+ this . headers . set ( "content-type" , "text/plain" ) ;
2224 }
2325
2426 public override readBuffer ( ) {
You can’t perform that action at this time.
0 commit comments