File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -862,11 +862,6 @@ fn parse_full(mut s: Bytes) -> Result<Uri, InvalidUri> {
862
862
} ) ;
863
863
}
864
864
865
- // Authority is required when absolute
866
- if authority_end == 0 {
867
- return Err ( ErrorKind :: InvalidFormat . into ( ) ) ;
868
- }
869
-
870
865
let authority = s. split_to ( authority_end) ;
871
866
let authority = Authority {
872
867
data : unsafe { ByteStr :: from_utf8_unchecked ( authority) } ,
Original file line number Diff line number Diff line change @@ -384,6 +384,19 @@ test_parse! {
384
384
port = Port :: from_str( "8008" ) . ok( ) ,
385
385
}
386
386
387
+ test_parse ! {
388
+ test_file_no_host,
389
+ "file:///some/path" ,
390
+ [ ] ,
391
+
392
+ scheme = part!( "file" ) ,
393
+ authority = None ,
394
+ host = None ,
395
+ path = "/some/path" ,
396
+ query = None ,
397
+ port = None ,
398
+ }
399
+
387
400
test_parse ! {
388
401
test_percentage_encoded_path,
389
402
"/echo/abcdefgh_i-j%20/abcdefg_i-j%20478" ,
@@ -419,7 +432,6 @@ fn test_uri_parse_error() {
419
432
Uri :: from_str ( s) . unwrap_err ( ) ;
420
433
}
421
434
422
- err ( "http://" ) ;
423
435
err ( "htt:p//host" ) ;
424
436
err ( "hyper.rs/" ) ;
425
437
err ( "hyper.rs?key=val" ) ;
You can’t perform that action at this time.
0 commit comments