From c67b94881c7748f1682c47dc857d5be38f93a0a0 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Mon, 7 Oct 2024 14:27:27 -0700 Subject: [PATCH] Just use path if there's a file scheme. This leaves out a potential host, which isn't supported anyway. --- lib/rdf/util/file.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rdf/util/file.rb b/lib/rdf/util/file.rb index a4b8e4c8..c17fcd3f 100644 --- a/lib/rdf/util/file.rb +++ b/lib/rdf/util/file.rb @@ -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|