Some small changes.

This commit is contained in:
Kavin 2022-09-25 22:33:29 +01:00
parent 52370036e3
commit 51185f2558
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD
3 changed files with 5 additions and 6 deletions

View File

@ -38,5 +38,5 @@ hibernate.dialect:org.hibernate.dialect.PostgreSQLDialect
hibernate.connection.username:piped hibernate.connection.username:piped
hibernate.connection.password:changeme hibernate.connection.password:changeme
# Frontend configuration # Frontend configuration
frontend.statusPageUrl:https://kavin.rocks #frontend.statusPageUrl:https://kavin.rocks
frontend.donationUrl:https://kavin.rocks #frontend.donationUrl:https://kavin.rocks

View File

@ -54,7 +54,7 @@ public class ServerLauncher extends MultithreadedHttpServerLauncher {
} }
})).map(GET, "/config", AsyncServlet.ofBlocking(executor, request -> { })).map(GET, "/config", AsyncServlet.ofBlocking(executor, request -> {
try { try {
return getJsonResponse(ResponseHelper.configResponse(), "no-store"); return getJsonResponse(ResponseHelper.configResponse(), "public, max-age=86400");
} catch (Exception e) { } catch (Exception e) {
return getErrorResponse(e, request.getPath()); return getErrorResponse(e, request.getPath());
} }

View File

@ -2,7 +2,6 @@ package me.kavin.piped.consts;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.ObjectNode;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import me.kavin.piped.utils.PageMixin; import me.kavin.piped.utils.PageMixin;
import okhttp3.OkHttpClient; import okhttp3.OkHttpClient;
@ -105,8 +104,8 @@ public class Constants {
String key = String.valueOf(_key), value = String.valueOf(_value); String key = String.valueOf(_key), value = String.valueOf(_value);
if (key.startsWith("hibernate")) if (key.startsWith("hibernate"))
hibernateProperties.put(key, value); hibernateProperties.put(key, value);
else if (key.startsWith("frontend")) else if (key.startsWith("frontend."))
frontendProperties.put(key.replace("frontend.", ""), value); frontendProperties.put(StringUtils.substringAfter(key, "frontend."), value);
}); });
// transform hibernate properties for legacy configurations // transform hibernate properties for legacy configurations