Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix insecure images #56

Open
NetOpWibby opened this issue Feb 19, 2019 · 0 comments
Open

Fix insecure images #56

NetOpWibby opened this issue Feb 19, 2019 · 0 comments

Comments

@NetOpWibby
Copy link

On the homepage, there are links served from insecure domains. This makes the padlock in Firefox's URL bar gray with a caution sign.

Here's a function I made for .tech:

function makeImageSourceSecure(url) {
  const originalUrl = new URL(url);

  if (originalUrl.protocol !== "https")
    return `https://${originalUrl.host}${originalUrl.pathname}`;

  return originalUrl.href;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants