Skip to content

Commit 059d372

Browse files
author
Milan Ševčík
committed
Fix file_uri for files already in proper URI
Fixes access to files accessed through Java ClassLoader in JRuby
1 parent 2f95d53 commit 059d372

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/json-schema/util/uri.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,11 @@ def self.strip_fragment(uri)
8787

8888
def self.file_uri(uri)
8989
parsed_uri = parse(uri)
90-
91-
Addressable::URI.convert_path(parsed_uri.path)
90+
if not parsed_uri.scheme.nil?
91+
parsed_uri
92+
else
93+
Addressable::URI.convert_path(parsed_uri.path)
94+
end
9295
end
9396

9497
def self.unescape_uri(uri)

0 commit comments

Comments
 (0)