Fix ArrayIndexOutOfBounds for in startByName

This commit is contained in:
0xb00bface 2021-01-01 17:56:17 +01:00
parent 62602b552f
commit 68e8f3770e
1 changed files with 3 additions and 0 deletions

View File

@ -271,6 +271,9 @@ public class RecorderServlet extends AbstractCtbrecServlet {
private void startByName(Request request) throws InvalidKeyException, NoSuchAlgorithmException, IOException {
String[] input = request.model.getUrl().split(":");
if (input.length != 2) {
throw new IllegalArgumentException("Invalid input. Should be site:model");
}
String siteName = input[0];
String modelName = input[1];
for (Site site : sites) {