Bug fixes (im frustrated)

This commit is contained in:
UnlegitDqrk
2026-02-08 21:40:23 +01:00
parent 68802e4317
commit e3fee17a73
7 changed files with 127 additions and 33 deletions

View File

@@ -43,7 +43,7 @@ public final class HttpsProxy {
return new WebResponsePacket(
502,
"text/plain; charset=utf-8",
Map.of(),
HeaderMaps.mutable(),
("Bad Gateway: " + e.getClass().getName() + ": " + e.getMessage()).getBytes(StandardCharsets.UTF_8)
);
}
@@ -54,7 +54,7 @@ public final class HttpsProxy {
return new WebResponsePacket(
508,
"text/plain; charset=utf-8",
Map.of(),
HeaderMaps.mutable(),
"Too many redirects".getBytes(StandardCharsets.UTF_8)
);
}
@@ -82,7 +82,7 @@ public final class HttpsProxy {
return new WebResponsePacket(
502,
"text/plain; charset=utf-8",
Map.of(),
HeaderMaps.mutable(),
("Bad Gateway: redirect without Location (code=" + code + ")").getBytes(StandardCharsets.UTF_8)
);
}
@@ -104,8 +104,7 @@ public final class HttpsProxy {
con.disconnect();
}
Map<String, String> headers = new HashMap<>();
return new WebResponsePacket(code, contentType, headers, body);
return new WebResponsePacket(code, contentType, HeaderMaps.mutable(), body);
}
private static byte[] readAllBytes(InputStream in) throws Exception {