Skip to content

Commit

Permalink
Just use path if there's a file scheme. This leaves out a potential h…
Browse files Browse the repository at this point in the history
…ost, which isn't supported anyway.
  • Loading branch information
gkellogg committed Oct 7, 2024
1 parent 47fdb73 commit c67b948
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rdf/util/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,9 @@ def self.open_file(filename_or_url, proxy: nil, headers: {}, verify_none: false,
url_no_frag_or_query.fragment = nil
options[:encoding] ||= Encoding::UTF_8

# Normalize a file scheme further
# Just use path if there's a file scheme. This leaves out a potential host, which isn't supported anyway.
if url_no_frag_or_query.scheme == 'file'
url_no_frag_or_query = "file:///#{url_no_frag_or_query.path}"
url_no_frag_or_query = url_no_frag_or_query.path
end

Kernel.open(url_no_frag_or_query, "r", **options) do |file|
Expand Down

0 comments on commit c67b948

Please sign in to comment.