Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia
TypeScript apiapi-clientapi-restapi-testingdeveloper-toolsgraphqlhttphttp-clientpwarestrest-apispatestingtesting-toolstoolsvuevuejswebsocket
Rename sseValid to httpValid
Andrew Bastin76d7a3f6d4c1
diff --git a/components/realtime/sse.vue b/components/realtime/sse.vueindex f8c13bafa..8fc678303 100644--- a/components/realtime/sse.vue+++ b/components/realtime/sse.vue@@ -40,7 +40,7 @@</template><script>-import { sseValid } from "~/functions/utils/valid"+import { httpValid } from "~/functions/utils/valid"export default {components: {@@ -60,7 +60,7 @@ export default {},computed: {serverValid() {- return sseValid(this.server)+ return httpValid(this.server)},},methods: {@@ -81,7 +81,7 @@ export default {if (typeof EventSource !== "undefined") {try {this.sse = new EventSource(this.server)- this.sse.onopen = event => {+ this.sse.onopen = (event) => {this.connectionSSEState = truethis.events.log = [{@@ -95,10 +95,10 @@ export default {icon: "sync",})}- this.sse.onerror = event => {+ this.sse.onerror = (event) => {this.handleSSEError()}- this.sse.onclose = event => {+ this.sse.onclose = (event) => {this.connectionSSEState = falsethis.events.log.push({payload: this.$t("disconnected_from", { name: this.server }),@@ -110,7 +110,7 @@ export default {icon: "sync_disabled",})}- this.sse.onmessage = event => {+ this.sse.onmessage = (event) => {this.events.log.push({payload: event.data,source: "server",diff --git a/functions/utils/valid.js b/functions/utils/valid.jsindex 99088ce41..b9ce017e3 100644--- a/functions/utils/valid.js+++ b/functions/utils/valid.js@@ -25,7 +25,7 @@ export function wsValid(url) {/*** valid url for http/https*/-export function sseValid(url) {+export function httpValid(url) {return sseRegexIP.test(url) || sseRegexHostname.test(url)}