Is there any actual issue with Flarum ?
It's normal HTTP that the header comes before the request is finished. The headers, which contain the status code are at the top of the response. Headers may have already been parsed and content is still being downloaded ?