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 = {
3636 enableAdditionalHeaders : false
3737}
3838
39+ const readonlyProp : PropertyDescriptor = { writable : false , configurable : false }
40+
3941/**
4042 * Implements [`multipart/form-data` encoding algorithm](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#multipart/form-data-encoding-algorithm),
4143 * 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 {
182184
183185 // Make sure following properties read-only in runtime.
184186 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
189191 } )
190192 }
191193
You can’t perform that action at this time.
0 commit comments