4
4
"encoding/json"
5
5
"fmt"
6
6
"net"
7
- gourl "net/url"
7
+ "net/url"
8
8
"reflect"
9
9
"regexp"
10
10
"sort"
@@ -372,8 +372,12 @@ func (pconf *Path) validate(
372
372
}
373
373
374
374
case strings .HasPrefix (pconf .Source , "rtsp://" ) ||
375
- strings .HasPrefix (pconf .Source , "rtsps://" ):
376
- _ , err := base .ParseURL (pconf .Source )
375
+ strings .HasPrefix (pconf .Source , "rtsps://" ) ||
376
+ strings .HasPrefix (pconf .Source , "rtsp+http://" ) ||
377
+ strings .HasPrefix (pconf .Source , "rtsps+http://" ) ||
378
+ strings .HasPrefix (pconf .Source , "rtsp+ws://" ) ||
379
+ strings .HasPrefix (pconf .Source , "rtsps+ws://" ):
380
+ _ , err := url .Parse (pconf .Source )
377
381
if err != nil {
378
382
return fmt .Errorf ("'%s' is not a valid URL" , pconf .Source )
379
383
}
@@ -390,7 +394,7 @@ func (pconf *Path) validate(
390
394
391
395
case strings .HasPrefix (pconf .Source , "rtmp://" ) ||
392
396
strings .HasPrefix (pconf .Source , "rtmps://" ):
393
- u , err := gourl .Parse (pconf .Source )
397
+ u , err := url .Parse (pconf .Source )
394
398
if err != nil {
395
399
return fmt .Errorf ("'%s' is not a valid URL" , pconf .Source )
396
400
}
@@ -406,15 +410,11 @@ func (pconf *Path) validate(
406
410
407
411
case strings .HasPrefix (pconf .Source , "http://" ) ||
408
412
strings .HasPrefix (pconf .Source , "https://" ):
409
- u , err := gourl .Parse (pconf .Source )
413
+ u , err := url .Parse (pconf .Source )
410
414
if err != nil {
411
415
return fmt .Errorf ("'%s' is not a valid URL" , pconf .Source )
412
416
}
413
417
414
- if u .Scheme != "http" && u .Scheme != "https" {
415
- return fmt .Errorf ("'%s' is not a valid URL" , pconf .Source )
416
- }
417
-
418
418
if u .User != nil {
419
419
pass , _ := u .User .Password ()
420
420
user := u .User .Username ()
@@ -454,14 +454,14 @@ func (pconf *Path) validate(
454
454
}
455
455
456
456
case strings .HasPrefix (pconf .Source , "srt://" ):
457
- _ , err := gourl .Parse (pconf .Source )
457
+ _ , err := url .Parse (pconf .Source )
458
458
if err != nil {
459
459
return fmt .Errorf ("'%s' is not a valid URL" , pconf .Source )
460
460
}
461
461
462
462
case strings .HasPrefix (pconf .Source , "whep://" ) ||
463
463
strings .HasPrefix (pconf .Source , "wheps://" ):
464
- _ , err := gourl .Parse (pconf .Source )
464
+ _ , err := url .Parse (pconf .Source )
465
465
if err != nil {
466
466
return fmt .Errorf ("'%s' is not a valid URL" , pconf .Source )
467
467
}
0 commit comments