Hi @snicoll,
I have the configuration below:
@Bean
CodecCustomizer multiPartCodecCustomizer() {
return configurer -> {
SynchronossPartHttpMessageReader partReader = new SynchronossPartHttpMessageReader();
partReader.setMaxParts(5);
configurer.customCodecs().register(partReader);
MultipartHttpMessageReader multipartHttpMessageReader = new MultipartHttpMessageReader(partReader);
configurer.customCodecs().register(multipartHttpMessageReader);
};
}
When:
curl --location --request POST 'http://localhost:8080/api/v1/test/bulk' \
--header 'Content-Type: multipart/form-data' \
--form 'files=@"/C:/Users/test/payload.csv"' \
--form 'files=@"/C:/Users/test/payload(1).csv"' \
--form 'files=@"/C:/Users/test/payload(2).csv"' \
--form 'files=@"/C:/Users/test/payload(3).csv"' \
--form 'files=@"/C:/Users/test/payload(4).csv"' \
--form 'files=@"/C:/Users/test/payload(5).csv"' \
Actual:
{
"timestamp": "2021-07-27T09:39:55.438+00:00",
"path": "/api/v1/test/bulk",
"status": 400,
"error": "Bad Request",
"message": "Failure while parsing part[6]; nested exception is org.springframework.core.codec.DecodingException: Too many parts (6 allowed)",
"requestId": "17ee076c-1"
}
Expected:
{
"timestamp": "2021-07-27T09:39:55.438+00:00",
"path": "/api/v1/test/bulk",
"status": 400,
"error": "Bad Request",
"message": "Failure while parsing part[6]; nested exception is org.springframework.core.codec.DecodingException: Too many parts (6/5 allowed)",
"requestId": "17ee076c-1"
}
I checked DefaultMultipartMessageReader
which seems to be correct. Unfortunately, I'm using an old version of Spring Boot 2.3.x
and I couldn't upgrade.
Thanks
Comment From: pivotal-cla
@aoudiamoncef Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.
Comment From: pivotal-cla
@aoudiamoncef Thank you for signing the Contributor License Agreement!