Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Commit

Permalink
fix warnings in GetObject about incorrent headers ([#54](#54))
Browse files Browse the repository at this point in the history
  • Loading branch information
romangrebennikov committed Jun 19, 2017
1 parent 8fdd60f commit ad65337
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* getETag from getObjectMetadata returns null ([#48](https://github.com/findify/s3mock/issues/48))
* update to akka 2.5.2, akka-http 10.0.7
* fix concurrent requests causing weird locking issues on FileProvider ([#52](https://github.com/findify/s3mock/issues/52))
* fix warnings in GetObject about incorrent headers ([#54](https://github.com/findify/s3mock/issues/54))

0.2.2
=======
Expand Down
2 changes: 2 additions & 0 deletions src/main/scala/io/findify/s3mock/route/GetObject.scala
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,13 @@ case class GetObject(implicit provider: Provider) extends LazyLogging {
)
}

val headerBlacklist = Set("content-type", "connection")
protected def metadataToHeaderList(metadata: ObjectMetadata): List[RawHeader] = {
val headers = Option(metadata.getRawMetadata)
.map(_.asScala.toMap)
.map(_.map { case (key, value) => RawHeader(key, value.toString)}.toList)
.toList.flatten
.filterNot(header => headerBlacklist.contains(header.lowercaseName))

val httpExpires = Option(metadata.getHttpExpiresDate).map(date => RawHeader(Headers.EXPIRES, DateUtils.formatRFC822Date(date)))

Expand Down

0 comments on commit ad65337

Please sign in to comment.