File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- 3.0.5
1+ 3.0.6
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ def self.each(file_name: nil,
8484 when content_type
8585 # @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17
8686 # @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7
87- mime_type = content_type . to_s . split ( ';' ) . first # remove any media type parameters
87+ mime_type = content_type . to_s . split ( ';' ) . first . to_s # remove any media type parameters
8888
8989 # Ignore text/plain, a historical encoding for N-Triples, which is
9090 # problematic in format detection, as many web servers will serve
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ class URI
5757
5858 IQUERY = Regexp . compile ( "(?:#{ IPCHAR } |#{ IPRIVATE } |/|\\ ?)*" ) . freeze
5959
60- IFRAGMENT = Regexp . compile ( "(?:#{ IPCHAR } |/|\\ ?)*" ) . freeze . freeze
60+ IFRAGMENT = Regexp . compile ( "(?:#{ IPCHAR } |/|\\ ?)*" ) . freeze
6161
6262 ISEGMENT = Regexp . compile ( "(?:#{ IPCHAR } )*" ) . freeze
6363 ISEGMENT_NZ = Regexp . compile ( "(?:#{ IPCHAR } )+" ) . freeze
@@ -223,6 +223,7 @@ def self.normalize_path(path)
223223 # @param [Boolean] canonicalize (false)
224224 def initialize ( *args , validate : false , canonicalize : false , **options )
225225 @value = @object = @hash = nil
226+ @mutex = Mutex . new
226227 uri = args . first
227228 if uri
228229 @value = uri . to_s
@@ -665,12 +666,14 @@ def dup
665666 # @private
666667 def freeze
667668 unless frozen?
668- # Create derived components
669- authority ; userinfo ; user ; password ; host ; port
670- @value = value . freeze
671- @object = object . freeze
672- @hash = hash . freeze
673- super
669+ @mutex . synchronize do
670+ # Create derived components
671+ authority ; userinfo ; user ; password ; host ; port
672+ @value = value . freeze
673+ @object = object . freeze
674+ @hash = hash . freeze
675+ super
676+ end
674677 end
675678 self
676679 end
You can’t perform that action at this time.
0 commit comments