You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're seeing an issue with Perfect-HTTP 3.1.6 where the Content-Length header is set incorrectly for some limited amount of responses (generated using response.setBody() ). In each case the reported content length is larger by 8 (for an empty response Content-Length was 8, for an empty json "{}" the reported length was 10).
We use the following code for success and failure cases, unfortunately the issue is very sporadic, hard to reproduce but nonetheless worrisome and trips up the client parsing.
It looks like a conflict with the response compression filter.
If you disable that does the problem resolve? If so, can you paste in your code for adding the routes & compression filter?
I appreciate the response. I wonder if you guys have a stress testing code that could be used to tease this out? Unfortunately the issue is very sporadic on our side so it's hard to reproduce/confirm.
Here are the snippets of code that we use on the server, based on one of the past revisions of https://perfect.org/docs/
The compressor running for empty and very small response bodies is problematic. I have corrected this in HTTPServer 3.0.19 (just now). I'm not sure if this is the cause of your problem, but it may help make things clearer. 8 bytes is the proper length for a "compressed" empty body, but you should no longer see that if you update the package.
Please let me know if you see any change after updating.
We're seeing an issue with Perfect-HTTP 3.1.6 where the Content-Length header is set incorrectly for some limited amount of responses (generated using response.setBody() ). In each case the reported content length is larger by 8 (for an empty response Content-Length was 8, for an empty json "{}" the reported length was 10).
We use the following code for success and failure cases, unfortunately the issue is very sporadic, hard to reproduce but nonetheless worrisome and trips up the client parsing.
response.setBody(string: error).completed(status: .badRequest)
Example client parsing issue:
The text was updated successfully, but these errors were encountered: