diff --git a/README.md b/README.md index 7f0a8156..77d21811 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,17 @@ JsonLd.compact(document, contextDocument).get(); ... ``` +#### HTTP Document Loader Timeout +Configure and set a custom HTTP document loader instance. + +```javascript +// since 1.4.0 - set read timeout +static DocumentLoader LOADER = HttpLoader.defaultInstance().timeount(Duration.ofSeconds(30)); +... +JsonLd.expand(...).loader(LOADER).get(); +``` + + ## Contributing All PR's welcome! diff --git a/src/main/java/com/apicatalog/jsonld/loader/SchemeRouter.java b/src/main/java/com/apicatalog/jsonld/loader/SchemeRouter.java index efea9e65..adc072d2 100644 --- a/src/main/java/com/apicatalog/jsonld/loader/SchemeRouter.java +++ b/src/main/java/com/apicatalog/jsonld/loader/SchemeRouter.java @@ -30,7 +30,7 @@ public final class SchemeRouter implements DocumentLoader { .set("http", HttpLoader.defaultInstance()) .set("https", HttpLoader.defaultInstance()) .set("file", new FileLoader()); - + private final Map loaders; public SchemeRouter() {