The expected behavior is that this handler can handle multipart/form-data requests correctly.
Current Behavior
Currently, it outputs an error message like the following:
{
"message": "Cannot read properties of undefined (reading 'length')"
}
Possible Solution
This issue seems to be caused by an incorrect implementation of the template engine, specifically expressTemplateService.ts line 84.
The current implementation treats all fields in formData as files if any file is included in the multipart/form-data request. As a result, it fails to handle non-file fields correctly.
Sorting
I'm submitting a ...
I confirm that I
Expected Behavior
The following code is an example of a post endpoint handler:
The expected behavior is that this handler can handle multipart/form-data requests correctly.
Current Behavior
Currently, it outputs an error message like the following:
Possible Solution
This issue seems to be caused by an incorrect implementation of the template engine, specifically expressTemplateService.ts line 84. The current implementation treats all fields in formData as files if any file is included in the multipart/form-data request. As a result, it fails to handle non-file fields correctly.
To address this issue, the code should be modified as follows:
May I publish pull request for this issue?
Context (Environment)
Version of the library: 6.1.3 Version of NodeJS: 18