Skip to content

Commit

Permalink
do not add trailer if none exist
Browse files Browse the repository at this point in the history
  • Loading branch information
NavidJalali committed Oct 27, 2024
1 parent 5d6e330 commit 82b9e57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,9 @@ object PekkoHttpServerProviderScala extends PekkoHttpServerProvider with Directi
HttpEntity.LastChunk(last.extension, f(last.trailer))
}))
case _ =>
val origTrailers = response
response
.attribute(AttributeKeys.trailer)
.map(_.headers)
.getOrElse(Vector.empty)
.map(e => RawHeader(e._1, e._2))
response.addAttribute(AttributeKeys.trailer, Trailer(f(origTrailers)))
.map(trailer => Trailer(f(trailer.headers.map((RawHeader.apply _).tupled))))
.fold(response)(response.addAttribute(AttributeKeys.trailer, _))
})
}
2 changes: 1 addition & 1 deletion project/PekkoHttpDependency.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ import com.github.pjfanning.pekkobuild.PekkoDependency
object PekkoHttpDependency extends PekkoDependency {
override val checkProject: String = "pekko-http-testkit"
override val module: Option[String] = Some("http")
override val currentVersion: String = "1.1.0+13-750e8f96-SNAPSHOT"
override val currentVersion: String = "1.1.0"
}

0 comments on commit 82b9e57

Please sign in to comment.