ouinet
ouinet copied to clipboard
Better handling of non OK HTTP status codes in injector
At the moment, when the injector receives a message from the origin, it only checks the error code. But this error code has nothing to do with the response HTTP status code.
We need to check that, and handle non OK responses appropriately.
Sample 304 response I found in the cache:
HTTP/1.1 304 Not Modified
Content-Type: image/png
Last-Modified: Tue, 03 Jan 2017 21:29:30 GMT
Cache-Control: max-age=1661425
Expires: Tue, 02 Jan 2018 16:25:41 GMT
Date: Thu, 14 Dec 2017 10:55:16 GMT
Connection: keep-alive
Access-Control-Allow-Methods: GET
Access-Control-Allow-Origin: *
I added first workaround to only store HTTP/OK responses for now:
https://github.com/equalitie/ouinet/commit/cb31fe4cc4d8cf4cabe18afdba00c5512fd23eb3