File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -242,16 +242,17 @@ export function testUrl(url: string): Observable<string> {
242242 if ( typeof url !== 'string' ) {
243243 return throwError ( error )
244244 }
245+ const trimmedUrl = url . trim ( )
245246 let parsed
246247 try {
247- parsed = new URL ( url )
248+ parsed = new URL ( trimmedUrl )
248249 } catch ( err ) {
249250 return throwError ( error )
250251 }
251252 if ( parsed && ! parsed . protocol . match ( / h t t p : | h t t p s : / ) ) {
252253 return throwError ( error )
253254 }
254- return of ( url )
255+ return of ( trimmedUrl )
255256}
256257
257258function optionsFromFile ( opts : { preserveFilename ?: boolean } , file : File ) {
Original file line number Diff line number Diff line change @@ -274,7 +274,7 @@ export default function Uploader(props: Props) {
274274 event . preventDefault ( )
275275 event . stopPropagation ( )
276276 const clipboardData = event . clipboardData || ( window as any ) . clipboardData
277- const url = clipboardData . getData ( 'text' )
277+ const url = clipboardData . getData ( 'text' ) ?. trim ( )
278278 if ( ! isValidUrl ( url ) ) {
279279 toast . push ( { status : 'error' , title : 'Invalid URL for Mux video input.' } )
280280 return
You can’t perform that action at this time.
0 commit comments