diff --git a/assets/css/styles.scss b/assets/css/styles.scss
index e403b7d7f..6fc3f46ab 100644
--- a/assets/css/styles.scss
+++ b/assets/css/styles.scss
@@ -132,7 +132,6 @@ fieldset.blue legend {
color: #57b5f9;
}
-<<<<<<< HEAD
fieldset.gray {
border-color: #9B9B9B;
}
diff --git a/pages/index.vue b/pages/index.vue
index b7d26f0ed..c3b4e4f05 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -15,7 +15,7 @@
-
+
@@ -23,7 +23,7 @@
-
+
@@ -235,14 +235,13 @@
noHistoryToClear() {
return this.history.length === 0;
},
- urlNotValid() {
- const pattern = new RegExp('^(https?:\\/\\/)?' +
- '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' +
- '((\\d{1,3}\\.){3}\\d{1,3}))' +
- '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' +
- '(\\?[;&a-z\\d%_.~+=-]*)?' +
- '(\\#[-a-z\\d_]*)?$', 'i');
- return !pattern.test(this.url)
+ isValidURL() {
+ const protocol = '^(https?:\\/\\/)?';
+
+ const validIP = new RegExp(protocol + "(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$");
+ const validHostname = new RegExp(protocol + "(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$");
+
+ return validIP.test(this.url) || validHostname.test(this.url);
},
rawRequestBody() {
const {
@@ -302,8 +301,8 @@
})
},
sendRequest() {
- if (this.urlNotValid) {
- alert('Please check the formatting of the URL')
+ if (!this.isValidURL()) {
+ alert('Please check the formatting of the URL');
return
}
const n = new Date().toLocaleTimeString()