File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Expand file tree Collapse file tree 3 files changed +12
-9
lines changed 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,
84
84
when content_type
85
85
# @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17
86
86
# @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
88
88
89
89
# Ignore text/plain, a historical encoding for N-Triples, which is
90
90
# 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
57
57
58
58
IQUERY = Regexp . compile ( "(?:#{ IPCHAR } |#{ IPRIVATE } |/|\\ ?)*" ) . freeze
59
59
60
- IFRAGMENT = Regexp . compile ( "(?:#{ IPCHAR } |/|\\ ?)*" ) . freeze . freeze
60
+ IFRAGMENT = Regexp . compile ( "(?:#{ IPCHAR } |/|\\ ?)*" ) . freeze
61
61
62
62
ISEGMENT = Regexp . compile ( "(?:#{ IPCHAR } )*" ) . freeze
63
63
ISEGMENT_NZ = Regexp . compile ( "(?:#{ IPCHAR } )+" ) . freeze
@@ -223,6 +223,7 @@ def self.normalize_path(path)
223
223
# @param [Boolean] canonicalize (false)
224
224
def initialize ( *args , validate : false , canonicalize : false , **options )
225
225
@value = @object = @hash = nil
226
+ @mutex = Mutex . new
226
227
uri = args . first
227
228
if uri
228
229
@value = uri . to_s
@@ -665,12 +666,14 @@ def dup
665
666
# @private
666
667
def freeze
667
668
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
674
677
end
675
678
self
676
679
end
You can’t perform that action at this time.
0 commit comments