Skip to content

Commit

Permalink
[ARCTIC-1091] Browser tab does not display Arctic's icon (apache#1092)
Browse files Browse the repository at this point in the history
fix-1091

Co-authored-by: shendanfeng01 <shendanfeng01@corp.netease.com>
  • Loading branch information
2 people authored and ShawHee committed Dec 29, 2023
1 parent d251237 commit 0dcec57
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import com.netease.arctic.ams.server.utils.ParamSignatureCalculator;
import com.netease.arctic.ams.server.utils.Utils;
import io.javalin.Javalin;
import io.javalin.http.ContentType;
import io.javalin.http.HttpCode;
import io.javalin.http.staticfiles.Location;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -130,10 +131,17 @@ public static void startRestServer(Integer port) {
app.routes(() -> {
/*backend routers*/
path("", () -> {
// /docs/latest can't be locationed to the index.html, so we add rule to redict to it.
// /docs/latest can't be located to the index.html, so we add rule to redirect to it.
get("/docs/latest", ctx -> ctx.redirect("/docs/latest/index.html"));
// unify all addSinglePageRoot(like /tables, /optimizers etc) configure here
get("/{page}", ctx -> ctx.html(getFileContent()));
get("/{page}", ctx -> {
if ("favicon.ico".equals(ctx.pathParam("page"))) {
ctx.contentType(ContentType.IMAGE_ICO);
ctx.result(AmsRestServer.class.getClassLoader().getResourceAsStream("static/favicon.ico"));
} else {
ctx.html(getFileContent());
}
});
get("/hive-tables/upgrade", ctx -> ctx.html(getFileContent()));
});
path("/ams/v1", () -> {
Expand Down

0 comments on commit 0dcec57

Please sign in to comment.