Fixed rest-api loading. Headers confirmed to be applied for docs.
diff --git a/nifi-registry-core/nifi-registry-jetty/src/main/java/org/apache/nifi/registry/jetty/JettyServer.java b/nifi-registry-core/nifi-registry-jetty/src/main/java/org/apache/nifi/registry/jetty/JettyServer.java
index 58b6249..387857f 100644
--- a/nifi-registry-core/nifi-registry-jetty/src/main/java/org/apache/nifi/registry/jetty/JettyServer.java
+++ b/nifi-registry-core/nifi-registry-jetty/src/main/java/org/apache/nifi/registry/jetty/JettyServer.java
@@ -438,6 +438,21 @@
docsContext.addServlet(docs, "/html/*");
docsContext.addServlet(defaultHolder, "/");
+ // load the rest documentation
+ final File webApiDocsDir = new File(webApiContext.getTempDirectory(), "webapp/docs");
+ if (!webApiDocsDir.exists()) {
+ final boolean made = webApiDocsDir.mkdirs();
+ if (!made) {
+ throw new RuntimeException(webApiDocsDir.getAbsolutePath() + " could not be created");
+ }
+ }
+
+ ServletHolder apiDocs = new ServletHolder("apiDocs", DefaultServlet.class);
+ apiDocs.setInitParameter("resourceBase", webApiDocsDir.getPath());
+ apiDocs.setInitParameter("dirAllowed", "false");
+
+ docsContext.addServlet(apiDocs, "/rest-api/*");
+
logger.info("Loading documents web app with context path set to " + docsContext.getContextPath());
} catch (Exception ex) {