File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ const defaultOptions: FormDataEncoderOptions = {
36
36
enableAdditionalHeaders : false
37
37
}
38
38
39
+ const readonlyProp : PropertyDescriptor = { writable : false , configurable : false }
40
+
39
41
/**
40
42
* Implements [`multipart/form-data` encoding algorithm](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#multipart/form-data-encoding-algorithm),
41
43
* allowing to add support for spec-comliant [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) to an HTTP client.
@@ -182,10 +184,10 @@ export class FormDataEncoder {
182
184
183
185
// Make sure following properties read-only in runtime.
184
186
Object . defineProperties ( this , {
185
- boundary : { writable : false , configurable : false } ,
186
- contentType : { writable : false , configurable : false } ,
187
- contentLength : { writable : false , configurable : false } ,
188
- headers : { writable : false , configurable : false }
187
+ boundary : readonlyProp ,
188
+ contentType : readonlyProp ,
189
+ contentLength : readonlyProp ,
190
+ headers : readonlyProp
189
191
} )
190
192
}
191
193
You can’t perform that action at this time.
0 commit comments