Skip to content

Commit

Permalink
#1540 Fix paring of sort field
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Nov 13, 2020
1 parent 58ccc10 commit 169bb1f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion thehive/app/org/thp/thehive/controllers/v0/QueryCtrl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ trait QueryCtrl {
TH3Aggregation.fieldsParser

val sortParser: FieldsParser[InputSort] = FieldsParser("sort") {
case (_, FAny(s)) => Good(s)
case (_, FAny(s)) => Good(s.flatMap(_.split(',')))
case (_, FSeq(s)) => s.validatedBy(FieldsParser.string.apply)
case (_, FString(s)) => Good(s.split(',').toSeq)
case (_, FUndefined) => Good(Nil)
}.map("sort") { a =>
val fields = a.collect {
Expand Down

0 comments on commit 169bb1f

Please sign in to comment.