spring-framework icon indicating copy to clipboard operation
spring-framework copied to clipboard

Fixed DataBufferLimitException in WebFlux result in 413 instead of 500

Open mysend12 opened this issue 10 months ago • 5 comments

origin issue: https://github.com/spring-projects/spring-framework/issues/32113

hello. In WebFlux, when a DataBufferLimitException occurs because the payload is larger than the setting value (spring.codec.max-in-memory-size), a 413 Too Large Body status code should be returned, but a 500 status code was returned, so that part has been corrected.

  1. A ServerWebInputTooLargeException exception was declared, which inherits ResponseStatusException.
  2. When determining whether there is an error in the request value in AbstractMessageReaderArgumentResolver, if a DataBufferLimitException occurs, it is converted to ServerWebInputTooLargeException.
  3. Added tooLargeBody test code.

mysend12 avatar Mar 31 '24 11:03 mysend12

@mysend12 Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

pivotal-cla avatar Mar 31 '24 11:03 pivotal-cla

@mysend12 Thank you for signing the Contributor License Agreement!

pivotal-cla avatar Mar 31 '24 11:03 pivotal-cla

origin issue: #32113

  • Can you update PR description and commit message to include Fixes #32113 ?
  • Can you update copywright 2024 on top of each files?

injae-kim avatar Apr 01 '24 05:04 injae-kim

@injae-kim thanks for trying to help but please refrain from providing guidelines to contributors. The first one is actually wrong, we do not need a reference to the original issue in the commit message.

snicoll avatar Apr 04 '24 12:04 snicoll

oh sorry, I got it! actually PR author @mysend12 is my friend and I'm helping him to contribute(by pair programming!) so provide guideline by comment :) I'll don't do this~! 🙇 thank you!

injae-kim avatar Apr 04 '24 13:04 injae-kim

Thanks for your contribution @mysend12 , this is now merged in main and will be shipped with the next 6.2 milestone.

bclozel avatar May 13 '24 12:05 bclozel