Not secure urls are transformed to https
This commit is contained in:
parent
ab1ca48fca
commit
f7fe26235a
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "reddit-slideshow",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.2",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "reddit-slideshow",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.2",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"axios": "^0.19.0",
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user