You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] Regression
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
When two FilesInterceptors (multiple files!) are defined within one controller, only the last configuration options are applied. So when for the two endpoints two different fields are defined with @UseInterceptors(FilesInterceptor('first')) and @UseInterceptors(FilesInterceptor('second')), both will only accept second. It also doesn't work for a MulterOptions object like
I'm submitting a...
Current behavior
When two
FilesInterceptor
s (multiple files!) are defined within one controller, only the last configuration options are applied. So when for the two endpoints two different fields are defined with@UseInterceptors(FilesInterceptor('first'))
and@UseInterceptors(FilesInterceptor('second'))
, both will only acceptsecond
. It also doesn't work for aMulterOptions
object likeIt does work however for
FileInterceptor
s (single file!) or when two differentController
are defined.Expected behavior
The given configuration should be applied.
Minimal reproduction of the problem with instructions
Create a Controller with those two endpoints:
Make the following form-data POST requests to the given endpoint with a file in the given field:
first
first
400 - Unexpected field
first
second
200
second
second
200
It might be the other way around: first works, second doesn't.
What is the motivation / use case for changing the behavior?
Came up in this Stackoverflow question.
Environment
The text was updated successfully, but these errors were encountered: