File tree Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Concrete interface that the headers map should implement.
6
6
7
7
## Indexable
8
8
9
- ▪ [ key: ` string ` ] : ` string ` \| ` undefined `
9
+ ▪ [ key: ` string ` ] : ` string ` \| ` string ` [ ] \| ` undefined `
10
10
11
11
## Table of contents
12
12
@@ -15,6 +15,7 @@ Concrete interface that the headers map should implement.
15
15
- [ accept] ( Headers.md#accept )
16
16
- [ allow] ( Headers.md#allow )
17
17
- [ content-type] ( Headers.md#content-type )
18
+ - [ set-cookie] ( Headers.md#set-cookie )
18
19
19
20
## Properties
20
21
33
34
### content-type
34
35
35
36
• ` Optional ` ** content-type** : ` string `
37
+
38
+ ___
39
+
40
+ ### set-cookie
41
+
42
+ • ` Optional ` ** set-cookie** : ` string ` \| ` string ` [ ]
43
+
44
+ Always an array in Node. Duplicates are added to it.
45
+ Not necessarily true for other environments, make sure
46
+ to check the type during runtime.
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export function startTServer(
33
33
const [ body , init ] = await handle ( {
34
34
url : req . url ,
35
35
method : req . method ,
36
- headers : req . headers as Record < string , string > ,
36
+ headers : req . headers ,
37
37
body : await new Promise < string > ( ( resolve ) => {
38
38
let body = '' ;
39
39
req . on ( 'data' , ( chunk ) => ( body += chunk ) ) ;
Original file line number Diff line number Diff line change @@ -15,7 +15,13 @@ export interface Headers {
15
15
accept ?: string | undefined ;
16
16
allow ?: string | undefined ;
17
17
'content-type' ?: string | undefined ;
18
- [ key : string ] : string | undefined ;
18
+ /**
19
+ * Always an array in Node. Duplicates are added to it.
20
+ * Not necessarily true for other environments, make sure
21
+ * to check the type during runtime.
22
+ */
23
+ 'set-cookie' ?: string | string [ ] | undefined ;
24
+ [ key : string ] : string | string [ ] | undefined ;
19
25
}
20
26
21
27
/**
You can’t perform that action at this time.
0 commit comments