diff --git a/CHANGELOG.md b/CHANGELOG.md index f20d9fb..ab9e75c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 ======= diff --git a/src/main/scala/io/findify/s3mock/route/GetObject.scala b/src/main/scala/io/findify/s3mock/route/GetObject.scala index 7423baa..dd1881b 100644 --- a/src/main/scala/io/findify/s3mock/route/GetObject.scala +++ b/src/main/scala/io/findify/s3mock/route/GetObject.scala @@ -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)))