diff --git a/thehive/app/org/thp/thehive/controllers/v0/ObservableCtrl.scala b/thehive/app/org/thp/thehive/controllers/v0/ObservableCtrl.scala index e42332554d..098f320d34 100644 --- a/thehive/app/org/thp/thehive/controllers/v0/ObservableCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v0/ObservableCtrl.scala @@ -343,8 +343,8 @@ class ObservableCtrl @Inject() ( private def getZipFiles(observable: InputObservable, zipPassword: Option[String]): Seq[InputObservable] = observable.attachment.flatMap(_.swap.toSeq).flatMap { attachment => - val zipFile = new ZipFile(attachment.filepath.toFile) - val files: Seq[FileHeader] = zipFile.getFileHeaders.asScala.asInstanceOf[Seq[FileHeader]] + val zipFile = new ZipFile(attachment.filepath.toFile) + val files = zipFile.getFileHeaders.asScala if (zipFile.isEncrypted) zipFile.setPassword(zipPassword.getOrElse(configuration.get[String]("datastore.attachment.password")).toCharArray) diff --git a/thehive/app/org/thp/thehive/controllers/v1/ObservableCtrl.scala b/thehive/app/org/thp/thehive/controllers/v1/ObservableCtrl.scala index fdcada7e17..ede9f538ec 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/ObservableCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/ObservableCtrl.scala @@ -372,8 +372,8 @@ class ObservableCtrl @Inject() ( private def getZipFiles(observable: InputObservable, zipPassword: Option[String]): Seq[InputObservable] = observable.attachment.flatMap(_.swap.toSeq).flatMap { attachment => - val zipFile = new ZipFile(attachment.filepath.toFile) - val files: Seq[FileHeader] = zipFile.getFileHeaders.asScala.asInstanceOf[Seq[FileHeader]] + val zipFile = new ZipFile(attachment.filepath.toFile) + val files = zipFile.getFileHeaders.asScala if (zipFile.isEncrypted) zipFile.setPassword(zipPassword.getOrElse(configuration.get[String]("datastore.attachment.password")).toCharArray)