It is difficult to give a reproducible exemple, I summarise here the main components:
We have a front-end/back-end system on an ubuntu 18.04 server. The client side is a web plateform where users can create a project with characteristics (like name, date...). The front-end is coded in javascript, with a mongoDB behind, and communicates with a flask API. The web link is managed by a dedicated web proxy.
We face a very puzzling behavior we don't understand after days of debugging:
The front-end sends a www-form-urlencoded string parameter X to the API. This parameter is optional and can be empty.
We check that this parameter is in the request body
let X = req.body.X? req.body.X : "";
If the parameter is set, the requests succeed. However, if the parameter is omitted a weird behavior happens in the API :
We eventually found the reason why it failed. I document it here for the next one: The development version used the 'got' library for the http request. For whatever reason (we are still investigating and I will complete the answer once we find more), the request with an empty string failed for 'got'. We switched to the 'axios' library and all went fine.