Skip to content

Commit 47fdb73

Browse files
committed
More file scheme URI normalization in Util::File.open_file.
1 parent 2b7c781 commit 47fdb73

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lib/rdf/util/file.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,12 @@ def self.open_file(filename_or_url, proxy: nil, headers: {}, verify_none: false,
319319
url_no_frag_or_query.query = nil
320320
url_no_frag_or_query.fragment = nil
321321
options[:encoding] ||= Encoding::UTF_8
322+
323+
# Normalize a file scheme further
324+
if url_no_frag_or_query.scheme == 'file'
325+
url_no_frag_or_query = "file:///#{url_no_frag_or_query.path}"
326+
end
327+
322328
Kernel.open(url_no_frag_or_query, "r", **options) do |file|
323329
document_options = {
324330
base_uri: filename_or_url.to_s,

0 commit comments

Comments
 (0)