Open skyterra opened 6 months ago
Isn't this a serious issue?
We are having a weird situation where this might be the issue. We end with a request being responded with TWO json, where the first JSON seems to come from a previous request.
I can say thought the first request failed with a context cancel, and the second request when through successfully but the final response JSON seems to have, as mentioned, both message!
I don't see though how come the context could be shared between two request (I might not seeing in the library code..), even thought that seems exactly what it is happening!
case <-time.After(t.timeout): c.Abort()
If a timeout occurs and c.Abort() is called here, but the handler function has not completed execution (for example, waiting for database data to be read), it will still continue to execute. In such a case, when c.PureJSON() is called in the handler function, c may have already been used by subsequent requests.
so, i suggest remove timeout operation.