Git Product home page Git Product logo

Comments (4)

yhirose avatar yhirose commented on June 6, 2024

@Gondlar thanks for the detailed information. The problem that you mentioned only happens with a request which has the 'application/x-www-form-urlencoded' content type. CPPHTTPLIB_FORM_URL_ENCODED_PAYLOAD_MAX_LENGTH is made to protect a cpp-http server from attacks with huge 'www-form-urlencoded' data which may make detail::parse_query_text unresponsive. (detail::parse_query_text is a slow function and will keep all the key-value pairs in memory...)

Could you give me any suggestion where in REAME I can put such information that will help users? Thanks for your help.

from cpp-httplib.

Gondlar avatar Gondlar commented on June 6, 2024

I'd suggest the part that deals with "Set maximum payload length for reading a request body", that's where people who need to know this are most likely to look.

cpp-httplib/README.md

Lines 414 to 419 in e426a38

### Set maximum payload length for reading a request body
```c++
svr.set_payload_max_length(1024 * 1024 * 512); // 512MB
```

from cpp-httplib.

yhirose avatar yhirose commented on June 6, 2024

Does it sound good to you?

### Set maximum payload length for reading a request body

```c++
svr.set_payload_max_length(1024 * 1024 * 512); // 512MB

NOTE: When the request body content type is 'www-form-urlencoded', the actual payload length shouldn't exceed CPPHTTPLIB_FORM_URL_ENCODED_PAYLOAD_MAX_LENGTH.

from cpp-httplib.

Gondlar avatar Gondlar commented on June 6, 2024

Sounds fine, thanks!

from cpp-httplib.

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.