mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 04:01:10 -04:00
refactor checkValidUrl method
This commit is contained in:
@ -128,6 +128,14 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
checkValidUrl(url) {
|
checkValidUrl(url) {
|
||||||
|
if (
|
||||||
|
url.includes('http://localhost') ||
|
||||||
|
url.includes('http://127.0.0.1') ||
|
||||||
|
url.includes('https://localhost') ||
|
||||||
|
url.includes('https://127.0.0.1')
|
||||||
|
) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
let pattern = new RegExp(
|
let pattern = new RegExp(
|
||||||
'^(https?:\\/\\/)?' + // protocol
|
'^(https?:\\/\\/)?' + // protocol
|
||||||
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
|
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
|
||||||
|
|||||||
Reference in New Issue
Block a user