Use old url validation

This commit is contained in:
Jonas Schwabe
2017-02-03 21:35:36 +01:00
parent 63fe562349
commit 9996687bfe
2 changed files with 1 additions and 3 deletions

View File

@@ -1,6 +1,5 @@
const React = require('react');
const {Modal, Button, FormGroup, FormControl, ControlLabel, HelpBlock} = require('react-bootstrap');
const validUrl = require('valid-url');
class NewTeamModal extends React.Component {
constructor() {
@@ -51,7 +50,7 @@ class NewTeamModal extends React.Component {
if (this.state.teamUrl.length === 0) {
return 'URL is required.';
}
if (!validUrl.isUri(this.state.teamUrl)) {
if (!(/^https?:\/\/.*/).test(this.state.teamUrl.trim())) {
return 'URL should start with http:// or https://.';
}
return null;

View File

@@ -24,7 +24,6 @@
"react-addons-css-transition-group": "^15.4.1",
"react-bootstrap": "~0.30.7",
"react-dom": "^15.4.1",
"valid-url": "^1.0.9",
"yargs": "^3.32.0"
}
}