File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,11 @@ export const unpluginFactory: UnpluginFactory<Options> = options => ({
102102 return
103103 }
104104
105+ if ( target . match ( / ^ (?: h t t p s ? ) ? : \/ \/ / ) ) {
106+ consola . fail ( 'target must be a domain' )
107+ return
108+ }
109+
105110 const _printUrls = server . printUrls . bind ( server )
106111
107112 let source = `localhost:${ config . server . port || 5173 } `
@@ -138,6 +143,11 @@ export const unpluginFactory: UnpluginFactory<Options> = options => ({
138143 return
139144 }
140145
146+ if ( target . match ( / ^ (?: h t t p s ? ) ? : \/ \/ / ) ) {
147+ consola . fail ( 'target must be a domain' )
148+ return
149+ }
150+
141151 const devServer = {
142152 host : 'localhost' ,
143153 port : 8080 ,
@@ -200,6 +210,11 @@ export const unpluginFactory: UnpluginFactory<Options> = options => ({
200210 return
201211 }
202212
213+ if ( target . match ( / ^ (?: h t t p s ? ) ? : \/ \/ / ) ) {
214+ consola . fail ( 'target must be a domain' )
215+ return
216+ }
217+
203218 const devServer = {
204219 host : 'localhost' ,
205220 port : 8080 ,
Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ export default defineNuxtModule<ModuleOptions>({
3636 return
3737 }
3838
39+ if ( target . match ( / ^ (?: h t t p s ? ) ? : \/ \/ / ) ) {
40+ consola . fail ( 'target must be a domain' )
41+ return
42+ }
43+
3944 // https://github.com/nuxt/cli/issues/220#issuecomment-1735394141
4045 _nuxt . hook ( 'listen' , ( _ , listener ) => {
4146 const url = listener . url
You can’t perform that action at this time.
0 commit comments