File tree 2 files changed +9
-16
lines changed
2 files changed +9
-16
lines changed Original file line number Diff line number Diff line change 154
154
"description" : " Tells clients connected to devServer to use the provided path to connect." ,
155
155
"type" : " string"
156
156
},
157
- "username" : {
158
- "description" : " Tells clients connected to devServer to use the provided username to authenticate." ,
159
- "type" : " string"
160
- },
161
157
"password" : {
162
158
"description" : " Tells clients connected to devServer to use the provided password to authenticate." ,
163
159
"type" : " string"
185
181
"minLength" : 1
186
182
}
187
183
]
184
+ },
185
+ "username" : {
186
+ "description" : " Tells clients connected to devServer to use the provided username to authenticate." ,
187
+ "type" : " string"
188
188
}
189
189
}
190
190
}
Original file line number Diff line number Diff line change @@ -107,39 +107,32 @@ class DevServerPlugin {
107
107
/** @type {string } */
108
108
let username = '' ;
109
109
110
- // We are proxying dev server and need to specify custom `path`
111
110
if ( typeof options . client . webSocketURL . username !== 'undefined' ) {
112
111
username = options . client . webSocketURL . username ;
113
112
}
114
113
115
114
/** @type {string } */
116
115
let password = '' ;
117
116
118
- // We are proxying dev server and need to specify custom `path`
119
117
if ( typeof options . client . webSocketURL . password !== 'undefined' ) {
120
118
password = options . client . webSocketURL . password ;
121
119
}
122
120
123
- /** @type {Record<string, any> } */
124
- const searchParams = { } ;
121
+ const searchParams = new URLSearchParams ( ) ;
125
122
126
123
if ( typeof options . client . logging !== 'undefined' ) {
127
- searchParams . logging = options . client . logging ;
124
+ searchParams . set ( ' logging' , options . client . logging ) ;
128
125
}
129
126
127
+ const searchParamsString = searchParams . toString ( ) ;
128
+
130
129
return encodeURIComponent (
131
130
new URL (
132
131
`${ protocol } //${ username } ${ password ? `:${ password } ` : '' } ${
133
132
username || password ? `@` : ''
134
133
} ${ ipaddr . IPv6 . isIPv6 ( host ) ? `[${ host } ]` : host } ${
135
134
port ? `:${ port } ` : ''
136
- } ${ path || '/' } ${
137
- Object . keys ( searchParams ) . length > 0
138
- ? `?${ Object . entries ( searchParams )
139
- . map ( ( [ key , value ] ) => `${ key } =${ value } ` )
140
- . join ( '&' ) } `
141
- : ''
142
- } `
135
+ } ${ path || '/' } ${ searchParamsString ? `?${ searchParamsString } ` : '' } `
143
136
) . toString ( )
144
137
) . replace (
145
138
/ [ ! ' ( ) * ] / g,
You can’t perform that action at this time.
0 commit comments