Bug on multiple "onReceive" events
Hi,
Thank you for Fomo, it's a really nice project to work with. Simple and fast :1st_place_medal:
While using Fomo, I found the following bug:
In certain circumstances, e.g. when Fomo sits behind a reverse proxy, 1 request on the same file descriptor is split over multiple onReceive events.
So the first onReceive event gets most of the data, but then a second onReceive event is received with only a part (the rest) of the request.
Fomo is currently not handling this correctly.
I've made a quick fix that checks the onReceive $data for "\r\n\r\n" (2 newlines) that should constitute the end of the HTTP 1.0 GET request, and if not found stores it for the 2nd onReceive request. And only continues the onReceive code when the full request is received.
My change will not work for POST requests (with data), since then other conditions need to be checked, like Content-Length, etc.
So I don't think my change is worth a PR.
Hello jnymous
Thank you for your suggestion
We will check this option and solve it if possible
Hi jnymous,
The bug was fixed in the new version 💥