fzaninotto/Faker

lorempixel does not provide CORS headers

Closed this issue · 1 comments

alexm commented

CORS headers are needed in image preloading (e.g. Vue components using img tag), thus making default image provider in Faker a no go.

$ curl -I lorempixel.com/640/480/
HTTP/1.1 200 OK
Date: Mon, 11 Nov 2019 07:59:52 GMT
Server: Apache/2.4.10 (Debian)
Expires: Fri, 30 Oct 1998 14:19:41 GMT
Cache-Control: no-cache, no-store
Pragma: no-cache
Connection: close
Content-Type: image/jpeg

For instance, I added bluemmb/faker-picsum-photos-provider as a third party provider and it works fine.

Whether replacing the default provider or trying to get lorempixel to add CORS headers it's for you to decide, I just think it would be nice that the default Faker image provider could have CORS headers too.

Thanks for your amazing work!

This is not directly a bug in Faker itself but in the image provider. I suggest you to use another image provider in this case if it is required since there is nothing we can do on Faker side for this.

In the future the image provider will also be removed meaning it is deprecated at this point for 2.0