Closed nagylzs closed 2 years ago
I attempted to catch and return status codes as explained here, but it seems like it was not working as expected.
Please feel free to take a look at this branch: https://github.com/jasonraimondi/url-to-png/tree/status-codes and see if you are able to get it working as expected.
When the given URL returns HTTP 404, then the service returns the rendered image with HTTP 200. This is bad, because the caller cannot tell if there was an error or not. Of course, it is possible (in most cases) to do the original GET request and check for HTTP error codes before asking for a rendered PNG. But that is not very efficient.
Could you please change the program to return the original HTTP code for the request? I understand that it may break compatibility with current users, so here is my proposal with full backward compatibility.