File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,8 @@ def read(location)
8787 body = if uri . scheme . nil? || uri . scheme == 'file'
8888 uri = JSON ::Util ::URI . file_uri ( uri )
8989 read_file ( Pathname . new ( uri . path ) . expand_path )
90+ elsif uri . scheme == 'uri' && uri . path . start_with? ( "classloader:" )
91+ read_file ( Pathname . new ( uri ) . expand_path )
9092 else
9193 read_uri ( uri )
9294 end
@@ -128,7 +130,11 @@ def read_uri(uri)
128130
129131 def read_file ( pathname )
130132 if accept_file? ( pathname )
131- File . read ( JSON ::Util ::URI . unescaped_path ( pathname . to_s ) )
133+ if pathname . to_s . start_with? ( "uri:classloader:" )
134+ File . read ( pathname . to_s )
135+ else
136+ File . read ( JSON ::Util ::URI . unescaped_path ( pathname . to_s ) )
137+ end
132138 else
133139 raise JSON ::Schema ::ReadRefused . new ( pathname . to_s , :file )
134140 end
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ def self.strip_fragment(uri)
8787
8888 def self . file_uri ( uri )
8989 parsed_uri = parse ( uri )
90- if not parsed_uri . scheme . nil?
90+ if parsed_uri . scheme
9191 parsed_uri
9292 else
9393 Addressable ::URI . convert_path ( parsed_uri . path )
You can’t perform that action at this time.
0 commit comments