Bug #3594
closedURI class doesn't do file URL's properly.
Description
=begin
URI doesn't seem to output file URLs properly where there is an absolute path part.
For example.
require 'uri'
my_url = URI.parse("file:///var/lib/libvirt/images/")
p my_url.to_s
"file:/var/lib/libvirt/images/"
The double slash '//' should always appear according to the file URL specification.
=end
        
          
          Updated by akr (Akira Tanaka) over 14 years ago
          
          
        
        
      
      - Project changed from 8 to Ruby
 - Assignee set to akira (akira yamada)
 
        
          
          Updated by shyouhei (Shyouhei Urabe) over 13 years ago
          
          
        
        
      
      - Status changed from Open to Assigned
 
        
          
          Updated by mame (Yusuke Endoh) almost 13 years ago
          
          
        
        
      
      - Description updated (diff)
 
Is this specified in RFC or any spec?
--
Yusuke Endoh mame@tsg.ne.jp
        
          
          Updated by naruse (Yui NARUSE) almost 13 years ago
          
          
        
        
      
      mame (Yusuke Endoh) wrote:
Is this specified in RFC or any spec?
There's no available RFC of file URI scheme.
see also:
        
          
          Updated by mame (Yusuke Endoh) almost 8 years ago
          
          
        
        
      
      RFC 8089 (The "file" URI Scheme) has been published in 2017. It says:
      file-URI       = file-scheme ":" file-hier-part
      file-scheme    = "file"
      file-hier-part = ( "//" auth-path )
                     / local-path
      auth-path      = [ file-auth ] path-absolute
      local-path     = path-absolute
and RFC 3986 says:
      path-absolute = "/" [ segment-nz *( "/" segment ) ]
So, "file:/var/lib/libvirt/images/" does not conform the spec, I think.
The maintainer of lib/uri.rb is Akira Yamada, who seems inactive. Does anyone want to investigate and fix this issue?
        
          
          Updated by mame (Yusuke Endoh) almost 8 years ago
          
          
        
        
      
      - Status changed from Assigned to Rejected
 
Sorry, I misread the spec.  The URI is valid because it can be interpreted as file-scheme ":" local-path.  So, there is no problem.  Closing.
        
          
          Updated by naruse (Yui NARUSE) almost 8 years ago
          
          
        
        
      
      - Status changed from Rejected to Closed
 
I found the description in URL spec.
Therefore I fixed it at r60970.