File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,10 @@ export class ServerResponse extends Writable implements http.ServerResponse {
16
16
sendDate : boolean = false ;
17
17
finished : boolean = false ;
18
18
headersSent : boolean = false ;
19
+ strictContentLength = false ;
19
20
connection : Socket | null = null ;
20
21
socket : Socket | null = null ;
22
+
21
23
req : http . IncomingMessage ;
22
24
23
25
_headers : HeadersObject = { } ;
@@ -78,6 +80,17 @@ export class ServerResponse extends Writable implements http.ServerResponse {
78
80
return this ;
79
81
}
80
82
83
+ appendHeader ( name : string , value : string | string [ ] ) {
84
+ name = name . toLowerCase ( )
85
+ const current = this . _headers [ name ] ;
86
+ const all = [
87
+ ...( Array . isArray ( current ) ? current : [ current ] ) ,
88
+ ...( Array . isArray ( value ) ? value : [ value ] ) ,
89
+ ] . filter ( Boolean ) as string [ ] ;
90
+ this . _headers [ name ] = all . length > 1 ? all : all [ 0 ] ;
91
+ return this ;
92
+ }
93
+
81
94
setHeader (
82
95
name : string ,
83
96
value : number | string | ReadonlyArray < string >
Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ export const _exceptionWithHostPort = notImplemented(
28
28
"util._exceptionWithHostPort"
29
29
) ;
30
30
export const _extend = notImplemented ( "util._extend" ) ;
31
+
32
+ export const aborted : typeof util . aborted = notImplemented ( "util.aborted" ) ;
31
33
export const callbackify : typeof util . callbackify =
32
34
notImplemented ( "util.callbackify" ) ;
33
35
export const getSystemErrorMap : typeof util . getSystemErrorMap = notImplemented (
@@ -51,6 +53,7 @@ export default <typeof util>{
51
53
_errnoException,
52
54
_exceptionWithHostPort,
53
55
_extend,
56
+ aborted,
54
57
callbackify,
55
58
deprecate,
56
59
getSystemErrorMap,
You can’t perform that action at this time.
0 commit comments