feat: DOPI/{contractID}/assets/ automatically append index.html

This commit is contained in:
CaiHQ 2021-11-05 09:44:20 +08:00
parent d634ebefb3
commit db15d105be
2 changed files with 4 additions and 0 deletions

View File

@ -5,6 +5,8 @@ plugins {
mainClassName = 'org.bdware.server.CMHttpServer' mainClassName = 'org.bdware.server.CMHttpServer'
application { application {
mainClass = mainClassName mainClass = mainClassName
applicationDefaultJvmArgs = ['-Dfile.encoding=UTF-8', '-Djava.library.path="./dynamicLibrary"'] applicationDefaultJvmArgs = ['-Dfile.encoding=UTF-8', '-Djava.library.path="./dynamicLibrary"']

View File

@ -212,6 +212,8 @@ public class DOIPOverHttpHandler {
int index = data[0].length() + data[1].length() + data[2].length() + 2; int index = data[0].length() + data[1].length() + data[2].length() + 2;
String path = fulluri.substring(index); String path = fulluri.substring(index);
path = path.replaceAll("\\?.*$", ""); path = path.replaceAll("\\?.*$", "");
if (path.equals("/assets/"))
path+="index.html";
transformedParam.addProperty("argument", path); transformedParam.addProperty("argument", path);
} }
if (assetPath.startsWith("ypk?")) { if (assetPath.startsWith("ypk?")) {