etr / libhttpserver

C++ library for creating an embedded Rest HTTP server (and more)
GNU Lesser General Public License v2.1
884 stars 185 forks source link

Closes #268: Fix POST processing of final keys without values #269

Open JavierJF opened 2 years ago

JavierJF commented 2 years ago

Identify the Bug

https://github.com/etr/libhttpserver/issues/268

Description of the Change

The change is simple, instead of calling 'MHD_destroy_post_processor' in the destructor after the request has been processed, it's called before calling the registered processing callback.

Alternate Designs

I haven't think in alternate designs. I chose to call 'MHD_destroy_post_processor' right before mr->callback because I think it's the only place requiring of the final post processing of the request. Thus, keeping the two operation close makes sense.

Possible Drawbacks

If all the information is going to be used just by mr->callback, can't think of any drawback.

Verification Process

Sorry, internal testing, just testing over the endpoints in a third party application.

Release Notes