question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Images not load due to HTTPS error

See original GitHub issue

I’m under HTTPS but the module tries to load the images trought HTTP, it causes a security error in browser.

Example: https://stackblitz.com/edit/ng-lazyload-image

The URL is right, but the output is wrong.

Error:

Mixed Content: The page at 'https://stackblitz.com/edit/angular-material-product-list-v24izo?file=app%2Flist-example.ts' was loaded over HTTPS, but requested an insecure image 'http://lorempixel.com/100/100/shop/'. This request has been blocked; the content must be served over HTTPS.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
tjoskarcommented, Jan 8, 2018

Sorry for the out-of-scope issue.

No worries

But, just to know, any idea why ng-reflect is different from the real src?

ng-reflect is for debug purpose and will not be included if you build the app with production config. I do not know why the reflect sting is truncated but I guess Angular has set a max length of the string.

Also, do you have any suggestion of images API for replacing lorempixel.com?

No, not really. I trend to use placecage.com but there are some other goodness out there.

2reactions
tjoskarcommented, Jan 7, 2018

@odahcam, the problem seems to be lorempixel.com. It redirects to http if the url doesn’t end with a slash (for some reason). If you go to https://lorempixel.com/112/112/food it will redirect to http but if you visit https://lorempixel.com/112/112/food/ it does not redirect you.

It seems to work fine if you just change:

- let src = `https://lorempixel.com/${spec.size}/${imgName}/ ${spec.query}`;
+ let src = `https://lorempixel.com/${spec.size}/${imgName} ${spec.query}`; 

and:

- return `https://lorempixel.com/112/112/${imageName}`;
+ return `https://lorempixel.com/112/112/${imageName}/`;
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix the HTTPS Links to HTTP Image Error - Sitechecker
The error means that there are images loaded over insecure HTTP connections when you request an initial Hypertext Transfer Protocol Secure ...
Read more >
Images not showing up with https - Stack Overflow
If I re-enable the referer, and refresh again, then the images don't appear anymore. Which means there is something, related to the referer, ......
Read more >
7 Reasons Why Images Are Not Loading on Your Website
Website images fail to load for one of these seven common reasons.
Read more >
7 Ways to Fix Google Chrome Not Loading Images - MakeUseOf
Is your browser unable to load images? This can be frustrating, but you can try out these various methods to fix the issue...
Read more >
Image Not Loading After Upgrading to Https - WordPress.org
When I inspect element it it gives this error on the image: Failed to load resource: net::ERR_CERT_COMMON_NAME_INVALID. When I open up the image...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found