Fix check sequence of content type check

This commit is contained in:
cedb 2023-01-08 11:42:10 -05:00
parent 594faaf288
commit 361fd8a908

View file

@ -89,7 +89,8 @@ public class HttpServerHandler {
return;
}
if (!"application/json".contains(httpExchange.getRequestHeaders().getFirst("Content-Type"))) {
if (httpExchange.getRequestHeaders().getFirst("Content-Type") == null
|| !httpExchange.getRequestHeaders().getFirst("Content-Type").contains("application/json")) {
sendResponse(415, null, httpExchange);
return;
}