Skip to content

Commit eec1a43

Browse files
committed
Protect against mutating a frozen URI in Util::File.
Fixes #349.
1 parent 124d581 commit eec1a43

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/rdf/util/file.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def self.open_file(filename_or_url, proxy: nil, headers: {}, verify_none: false,
305305
content_type = format ? format.content_type.first : 'text/plain'
306306
# Open as a file, passing any options
307307
begin
308-
url_no_frag_or_query = RDF::URI(filename_or_url)
308+
url_no_frag_or_query = RDF::URI(filename_or_url).dup
309309
url_no_frag_or_query.query = nil
310310
url_no_frag_or_query.fragment = nil
311311
options[:encoding] ||= Encoding::UTF_8

0 commit comments

Comments
 (0)