Skip to content

Commit c2f6d28

Browse files
committed
Fix POST processing of final keys without values
'MHD_destroy_post_processor' should be called before the request callback for ensuring the processing of final keys without terminated values.
1 parent acc3e6a commit c2f6d28

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/webserver.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,11 @@ MHD_Result webserver::finalize_answer(MHD_Connection* connection, struct details
662662
if (found) {
663663
try {
664664
if (hrm->is_allowed(method)) {
665+
if (mr->pp != NULL) {
666+
MHD_destroy_post_processor(mr->pp);
667+
mr->pp = NULL;
668+
}
669+
665670
mr->dhrs = ((hrm)->*(mr->callback))(*mr->dhr); // copy in memory (move in case)
666671
if (mr->dhrs.get() == nullptr || mr->dhrs->get_response_code() == -1) {
667672
mr->dhrs = internal_error_page(mr);

0 commit comments

Comments
 (0)