diff --git a/src/main/java/com/flightstats/hub/channel/ChannelResource.java b/src/main/java/com/flightstats/hub/channel/ChannelResource.java index 4c9fbc1ee..424edcf28 100644 --- a/src/main/java/com/flightstats/hub/channel/ChannelResource.java +++ b/src/main/java/com/flightstats/hub/channel/ChannelResource.java @@ -131,6 +131,11 @@ public Response createChannel(@PathParam("channel") String channelName, String j log.trace("put channel {} {}", channelName, json); Optional oldConfig = channelService.getChannelConfig(channelName, false); ChannelConfig channelConfig = ChannelConfig.createFromJsonWithName(json, channelName); + if (channelConfig.getCreationDate()!= null) { + // If the creation date is being modified, throw a 500 error + return Response.status(Response.Status.INTERNAL_SERVER_ERROR) + .entity("Modification of the creation date is not allowed").build(); + } if (oldConfig.isPresent()) { ChannelConfig config = oldConfig.get(); log.trace("using old channel {} {}", config, config.getCreationDate().getTime());