Bug fixes

This commit is contained in:
UnlegitDqrk
2026-02-06 22:51:56 +01:00
parent 185d335795
commit fb87af8b9c
11 changed files with 15 additions and 15 deletions

View File

@@ -19,7 +19,7 @@ import java.nio.charset.StandardCharsets;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@Route(path = "api") @Route(path = "/api")
public class api implements WebPage { public class api implements WebPage {
@Override @Override
public WebResponsePacket handle(WebPageContext webPageContext) throws Exception { public WebResponsePacket handle(WebPageContext webPageContext) throws Exception {

View File

@@ -16,7 +16,7 @@ import java.nio.charset.StandardCharsets;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@Route(path = "docs.html") @Route(path = "/docs.html")
public class docs implements WebPage { public class docs implements WebPage {
@Override @Override
public WebResponsePacket handle(WebPageContext webPageContext) throws Exception { public WebResponsePacket handle(WebPageContext webPageContext) throws Exception {

View File

@@ -9,7 +9,7 @@ import org.openautonomousconnection.webserver.utils.HttpsProxy;
/** /**
* Proxies the HTTPS download page through OAC. * Proxies the HTTPS download page through OAC.
*/ */
@Route(path = "download.html") @Route(path = "/download.html")
public class download implements WebPage { public class download implements WebPage {
@Override @Override

View File

@@ -25,7 +25,7 @@ import java.util.Map;
* - action=delete_infoname, id * - action=delete_infoname, id
* - action=add_record, id (infoname_id), sub, type, value, ttl, priority, port, weight * - action=add_record, id (infoname_id), sub, type, value, ttl, priority, port, weight
*/ */
@Route(path = "ins/dashboard") @Route(path = "/ins/dashboard")
public final class dashboard implements WebPage { public final class dashboard implements WebPage {
@Override @Override

View File

@@ -11,7 +11,7 @@ import java.util.HashMap;
/** /**
* Landing page for the registrar frontend. * Landing page for the registrar frontend.
*/ */
@Route(path = "ins/index.html") @Route(path = "/ins/index.html")
public final class index implements WebPage { public final class index implements WebPage {
@Override @Override

View File

@@ -25,7 +25,7 @@ import java.util.Map;
* *
* Creates a session with SessionManager. * Creates a session with SessionManager.
*/ */
@Route(path = "ins/login") @Route(path = "/ins/login")
public final class login implements WebPage { public final class login implements WebPage {
@Override @Override
@@ -51,8 +51,8 @@ public final class login implements WebPage {
boolean ok = app.passwordHasher().verify(password, u.passwordEncoded()); boolean ok = app.passwordHasher().verify(password, u.passwordEncoded());
if (!ok) return renderForm("Invalid credentials."); if (!ok) return renderForm("Invalid credentials.");
String ip = (ctx.client.getConnection().getSocket() != null && ctx.client.getConnection().getSocket().getInetAddress() != null) String ip = (ctx.client.getConnection().getTcpSocket() != null && ctx.client.getConnection().getTcpSocket().getInetAddress() != null)
? ctx.client.getConnection().getSocket().getInetAddress().getHostAddress() ? ctx.client.getConnection().getTcpSocket().getInetAddress().getHostAddress()
: ""; : "";
String ua = ctx.request.getHeaders() != null ? ctx.request.getHeaders().getOrDefault("user-agent", "") : ""; String ua = ctx.request.getHeaders() != null ? ctx.request.getHeaders().getOrDefault("user-agent", "") : "";

View File

@@ -26,7 +26,7 @@ import java.util.Map;
* - users.username = sha256(username) as HEX (64 chars) * - users.username = sha256(username) as HEX (64 chars)
* - users.password = PBKDF2$sha256$... * - users.password = PBKDF2$sha256$...
*/ */
@Route(path = "ins/register") @Route(path = "/ins/register")
public final class register implements WebPage { public final class register implements WebPage {
@Override @Override
@@ -52,8 +52,8 @@ public final class register implements WebPage {
try { try {
int userId = app.dao().createUser(usernameHashHex, passwordEnc); int userId = app.dao().createUser(usernameHashHex, passwordEnc);
String ip = (ctx.client.getConnection().getSocket() != null && ctx.client.getConnection().getSocket().getInetAddress() != null) String ip = (ctx.client.getConnection().getTcpSocket() != null && ctx.client.getConnection().getTcpSocket().getInetAddress() != null)
? ctx.client.getConnection().getSocket().getInetAddress().getHostAddress() ? ctx.client.getConnection().getTcpSocket().getInetAddress().getHostAddress()
: ""; : "";
String ua = ctx.request.getHeaders() != null ? ctx.request.getHeaders().getOrDefault("user-agent", "") : ""; String ua = ctx.request.getHeaders() != null ? ctx.request.getHeaders().getOrDefault("user-agent", "") : "";

View File

@@ -9,7 +9,7 @@ import org.openautonomousconnection.webserver.utils.HttpsProxy;
/** /**
* Proxies the HTTPS wiki page through OAC. * Proxies the HTTPS wiki page through OAC.
*/ */
@Route(path = "index.html") @Route(path = "/index.html")
public class index implements WebPage { public class index implements WebPage {
@Override @Override

View File

@@ -9,7 +9,7 @@ import org.openautonomousconnection.webserver.utils.HttpsProxy;
/** /**
* Proxies the HTTPS INS page through OAC. * Proxies the HTTPS INS page through OAC.
*/ */
@Route(path = "ins.php") @Route(path = "/ins.php")
public class ins implements WebPage { public class ins implements WebPage {
@Override @Override

View File

@@ -9,7 +9,7 @@ import org.openautonomousconnection.webserver.utils.HttpsProxy;
/** /**
* Proxies the HTTPS license page through OAC. * Proxies the HTTPS license page through OAC.
*/ */
@Route(path = "license.html") @Route(path = "/license.html")
public class license implements WebPage { public class license implements WebPage {
@Override @Override

View File

@@ -9,7 +9,7 @@ import org.openautonomousconnection.webserver.utils.HttpsProxy;
/** /**
* Proxies the HTTPS wiki page through OAC. * Proxies the HTTPS wiki page through OAC.
*/ */
@Route(path = "wiki.html") @Route(path = "/wiki.html")
public class wiki implements WebPage { public class wiki implements WebPage {
@Override @Override