diff --git a/package-lock.json b/package-lock.json index 404634e..29481d7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "reddit-slideshow", - "version": "0.1.1", + "version": "0.1.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6dfc6c6..36936a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "reddit-slideshow", - "version": "0.1.1", + "version": "0.1.2", "private": true, "dependencies": { "axios": "^0.19.0", diff --git a/src/containers/App.js b/src/containers/App.js index 02a81a8..eba73ea 100644 --- a/src/containers/App.js +++ b/src/containers/App.js @@ -137,8 +137,12 @@ class App extends Component { /** * Only keep valid urls and extensions. * Returns a valid url or null if url parameter isn't valid. + * Not secure urls are transformed to https. */ filterUrl = (url) => { + // Transform http to https + url = url.replace("http://", "https://"); + const domain = url.match(/:\/\/(.+)\//)[1]; const extPattern = /\.[0-9a-z]+$/i; const match = url.match(extPattern);