Remove leftover validation

This commit is contained in:
2026-01-08 14:07:24 +01:00
parent 9f41ecce5a
commit b16aaa090c

View File

@@ -38,8 +38,6 @@ public class ChannelDirectoryService {
private static final Logger logger = LoggerFactory.getLogger(ChannelDirectoryService.class); private static final Logger logger = LoggerFactory.getLogger(ChannelDirectoryService.class);
private static final Pattern SAFE_FILENAME = Pattern.compile("[^a-zA-Z0-9._ -]"); private static final Pattern SAFE_FILENAME = Pattern.compile("[^a-zA-Z0-9._ -]");
private static final Pattern INIT_FUNCTION = Pattern.compile("\\bfunction\\s+init\\b");
private static final Pattern TICK_FUNCTION = Pattern.compile("\\bfunction\\s+tick\\b");
private static final String DEFAULT_CODE_MEDIA_TYPE = "application/javascript"; private static final String DEFAULT_CODE_MEDIA_TYPE = "application/javascript";
private final ChannelRepository channelRepository; private final ChannelRepository channelRepository;
@@ -439,12 +437,6 @@ public class ChannelDirectoryService {
if (source == null || source.isBlank()) { if (source == null || source.isBlank()) {
throw new ResponseStatusException(BAD_REQUEST, "Script source is required"); throw new ResponseStatusException(BAD_REQUEST, "Script source is required");
} }
if (!INIT_FUNCTION.matcher(source).find()) {
throw new ResponseStatusException(BAD_REQUEST, "Missing function: init");
}
if (!TICK_FUNCTION.matcher(source).find()) {
throw new ResponseStatusException(BAD_REQUEST, "Missing function: tick");
}
} }
private void enforceUploadLimit(long sizeBytes) { private void enforceUploadLimit(long sizeBytes) {