Skip to content

Commit 8e7e69f

Browse files
committed
fix: handle filepath error checks differently
1 parent e43e2d8 commit 8e7e69f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/reference-resolver.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ export class InvalidFileSystemPathError implements Error {
8686
}
8787
}
8888

89+
const isUrlLike = (s: string) => {
90+
return s.includes("://") || s.includes("localhost:");
91+
}
92+
8993
/**
9094
* Error thrown when given an invalid file system path as a reference.
9195
*
@@ -142,7 +146,7 @@ export default (fetch: any, fs: any) => {
142146
}
143147

144148
return reffedSchema;
145-
} else if (["$", ".", "/", ".."].indexOf(ref[0]) !== -1) {
149+
} else if (isUrlLike(ref) === false) {
146150
throw new InvalidFileSystemPathError(ref);
147151
}
148152

0 commit comments

Comments
 (0)