jasonraimondi / url-to-png

Selfhosted. URL to PNG utility featuring parallel rendering using Playwright for screenshots and with storage caching via Local, S3, or CouchDB
https://jasonraimondi.github.io/url-to-png/
MIT License
136 stars 26 forks source link

Invalid response returned for some urls. #6

Closed nagylzs closed 2 years ago

nagylzs commented 3 years ago

Here is an example. If I do a request like this:

http://localhost:5000/?url=https%3A%2F%2Ftest.localhost%2Ftest

Then I get HTTP 200 and Content-Type: image/png. But it actually returns the string "false".

Request Response

You can see that the response has content-length: 5 so it cannot be a valid image. It contains the string "false". But the header says Content-Type: image/png and HTTP 200. This is messed up.

By the way, "test.localhost" is a non-existent domain. The original request to https://test.localhost/test cannot return a HTTP code, because test.localhost cannot be connected and so there is no request to make. But this should never return with HTTP 200.

jasonraimondi commented 2 years ago

Sorry I just never saw this or maybe I did and forgot, but anyways, this is fixed in 1.3.2