Giter Site home page Giter Site logo

Property server.jetty.max-http-form-post-size not affecting POST body size limit in Spring Boot 3.2.4 with Jetty Server about spring-boot HOT 3 CLOSED

cristianobinetti avatar cristianobinetti commented on July 2, 2024
Property server.jetty.max-http-form-post-size not affecting POST body size limit in Spring Boot 3.2.4 with Jetty Server

from spring-boot.

Comments (3)

wilkinsona avatar wilkinsona commented on July 2, 2024

What sort of POST request are you sending and expected to be limited? As the property's name suggests, it only applies to POSTed form content. Spring Boot applies it to Jetty's ServletContextHandler.setMaxFormContentSize(int) and it is enforced by Jetty's ServletApiRequest.

If you're making some other kind of POST request, it is expected that the property will have no effect.

If you're successfully POSTing form content above the configured limit, it could be a Spring Boot bug as we're not correctly transferring the property. Alternatively, it could be a Jetty bug as it's not applying the limit correctly. If you would like us to spend some time investigating which of these is the case, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.

from spring-boot.

cristianobinetti avatar cristianobinetti commented on July 2, 2024

Thank you for your detailed response.

I am currently sending a POST request with JSON data (Content-Type: application/json), not form content (application/x-www-form-urlencoded or multipart/form-data). I wasn't aware that the server.jetty.max-http-form-post-size property only applies to POSTed form content. This clarifies why the property doesn't seem to affect my payload size limit.

Given that this property does not apply to JSON POST requests, is there any available property to set a payload size limit for JSON data in Jetty with Spring Boot?

Thank you,
Cristiano

from spring-boot.

wilkinsona avatar wilkinsona commented on July 2, 2024

is there any available property to set a payload size limit for JSON data in Jetty with Spring Boot?

No, there isn't. Programmatic configuration of a SizeLimitHandler (as you have shown above) is your best option.

from spring-boot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.