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> {
862862        } ) ; 
863863    } 
864864
865-     // Authority is required when absolute 
866-     if  authority_end == 0  { 
867-         return  Err ( ErrorKind :: InvalidFormat . into ( ) ) ; 
868-     } 
869- 
870865    let  authority = s. split_to ( authority_end) ; 
871866    let  authority = Authority  { 
872867        data :  unsafe  {  ByteStr :: from_utf8_unchecked ( authority)  } , 
Original file line number Diff line number Diff line change @@ -384,6 +384,19 @@ test_parse! {
384384    port = Port :: from_str( "8008" ) . ok( ) , 
385385} 
386386
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+ 
387400test_parse !  { 
388401    test_percentage_encoded_path, 
389402    "/echo/abcdefgh_i-j%20/abcdefg_i-j%20478" , 
@@ -419,7 +432,6 @@ fn test_uri_parse_error() {
419432        Uri :: from_str ( s) . unwrap_err ( ) ; 
420433    } 
421434
422-     err ( "http://" ) ; 
423435    err ( "htt:p//host" ) ; 
424436    err ( "hyper.rs/" ) ; 
425437    err ( "hyper.rs?key=val" ) ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments