File tree Expand file tree Collapse file tree
lib/src/main/java/dev/harrel/jsonschema Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44import com .sanctionco .jmail .net .InternetProtocolAddress ;
55
66import java .net .URI ;
7+ import java .net .URISyntaxException ;
78import java .time .format .DateTimeFormatter ;
89import java .util .*;
910import java .util .function .Consumer ;
@@ -225,10 +226,18 @@ private static void uriOperator(String value) throws FormatException {
225226
226227 private static void iriOperator (String value ) throws FormatException {
227228 try {
228- if (!URI .create (value ).isAbsolute ()) {
229+ URI uri = URI .create (value );
230+ if (!uri .isAbsolute ()) {
229231 throw new FormatException (String .format ("\" %s\" is relative" , value ));
230232 }
231- } catch (RuntimeException e ) {
233+ /*
234+ * https://www.rfc-editor.org/rfc/rfc3986.html#appendix-A
235+ * reg-name cannot contain unescaped ':', thus treating it as a server authority
236+ */
237+ if (uri .getRawSchemeSpecificPart ().contains (":" )) {
238+ uri .parseServerAuthority ();
239+ }
240+ } catch (URISyntaxException | RuntimeException e ) {
232241 throw new FormatException (e .getMessage ());
233242 }
234243 }
You can’t perform that action at this time.
0 commit comments