File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,14 @@ export class Encoder {
22
22
*/
23
23
readonly contentType : string
24
24
25
+ /**
26
+ * Returns headers object with Content-Type and Content-Length header
27
+ */
28
+ readonly headers : {
29
+ "Content-Type" : string
30
+ "Content-Length" : number
31
+ }
32
+
25
33
/**
26
34
* Returns field's footer
27
35
*/
@@ -65,16 +73,11 @@ export class Encoder {
65
73
this . #footer = new TextEncoder ( ) . encode (
66
74
`${ DASHES } ${ this . boundary } ${ DASHES } ${ CRLF . repeat ( 2 ) } `
67
75
)
68
- }
69
76
70
- /**
71
- * Returns headers object with Content-Type and Content-Length header
72
- */
73
- get headers ( ) {
74
- return {
77
+ this . headers = Object . freeze ( {
75
78
"Content-Type" : this . contentType ,
76
- "Content-Length" : this . getContentLength ( ) ,
77
- }
79
+ "Content-Length" : this . getContentLength ( )
80
+ } )
78
81
}
79
82
80
83
private _getFieldHeader ( name : string , value : unknown ) : Uint8Array {
You can’t perform that action at this time.
0 commit comments