From db15d105be554fae1158a1fc2918cedec6eaa0e4 Mon Sep 17 00:00:00 2001 From: CaiHQ Date: Fri, 5 Nov 2021 09:44:20 +0800 Subject: [PATCH] feat: DOPI/{contractID}/assets/ automatically append index.html --- build.gradle | 2 ++ src/main/java/org/bdware/server/http/DOIPOverHttpHandler.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/build.gradle b/build.gradle index e4b400b..e7d172e 100644 --- a/build.gradle +++ b/build.gradle @@ -5,6 +5,8 @@ plugins { mainClassName = 'org.bdware.server.CMHttpServer' + + application { mainClass = mainClassName applicationDefaultJvmArgs = ['-Dfile.encoding=UTF-8', '-Djava.library.path="./dynamicLibrary"'] diff --git a/src/main/java/org/bdware/server/http/DOIPOverHttpHandler.java b/src/main/java/org/bdware/server/http/DOIPOverHttpHandler.java index d28f839..55ab9eb 100644 --- a/src/main/java/org/bdware/server/http/DOIPOverHttpHandler.java +++ b/src/main/java/org/bdware/server/http/DOIPOverHttpHandler.java @@ -212,6 +212,8 @@ public class DOIPOverHttpHandler { int index = data[0].length() + data[1].length() + data[2].length() + 2; String path = fulluri.substring(index); path = path.replaceAll("\\?.*$", ""); + if (path.equals("/assets/")) + path+="index.html"; transformedParam.addProperty("argument", path); } if (assetPath.startsWith("ypk?")) {