picqer / picqer-php

PHP Client for the Picqer API
https://picqer.com/en/api
MIT License
18 stars 23 forks source link

Flush response headers #31

Closed kleiram closed 3 years ago

kleiram commented 3 years ago

When performing an HTTP request, we store the response headers in an internal array in the client (rawResponseHeaders). This is done to parse them at a later point.

This array is not reset when sending a new request. When a client is used for a long time, this will cause the array to keep growing with each received response header. This could cause PHP processes to run out of memory in, for example, long running processes reusing the same client instance.

This bug did not cause any issues related to rate limiting, since the headers were overwritten if they occurred more than once in the response headers array.