mirror of
https://github.com/aljazceru/signal-cli.git
synced 2025-12-26 02:24:21 +01:00
Change content-type check to check contains
So far it was doing an equals check, but a string like "application/json; charset=utf-8" is similarly valid. And some clients like OkHttp actually automatically add the charset. Closes #1152
This commit is contained in:
@@ -89,7 +89,8 @@ public class HttpServerHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!"application/json".equals(httpExchange.getRequestHeaders().getFirst("Content-Type"))) {
|
||||
final var contentType = httpExchange.getRequestHeaders().getFirst("Content-Type");
|
||||
if (contentType == null || !contentType.startsWith("application/json")) {
|
||||
sendResponse(415, null, httpExchange);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user