Skip to content

Commit 55fbd63

Browse files
committed
When reading a URI, canonicalize when interning, rather than after the fact, to avoid a frozen object error.
1 parent 08270ab commit 55fbd63

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/rdf/ntriples/reader.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,8 @@ def read_comment
272272
def read_uriref(intern: false, **options)
273273
if uri_str = match(URIREF)
274274
uri_str = self.class.unescape(uri_str)
275-
uri = RDF::URI.send(intern? && intern ? :intern : :new, uri_str)
275+
uri = RDF::URI.send(intern? && intern ? :intern : :new, uri_str, canonicalize: canonicalize?)
276276
uri.validate! if validate?
277-
uri.canonicalize! if canonicalize?
278277
uri
279278
end
280279
rescue ArgumentError

0 commit comments

Comments
 (0)