Skip to content

Commit

Permalink
Merge pull request #445 from guardian/preferences-proxy-transparent
Browse files Browse the repository at this point in the history
Forward body bytes rather than attempting to decode to utf-8
  • Loading branch information
davidfurey authored Aug 23, 2024
2 parents 2b90812 + 216f0e9 commit 9905b36
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controllers/PreferencesProxy.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ class PreferencesProxy(
val responseHeaders = response.headers.view.mapValues(_.head).toMap + (
"Cache-Control" -> "private, no-cache, no-store, must-revalidate, max-age=0", // do not cache whatsoever
)
new Status(response.status)(response.body).withHeaders(responseHeaders.toSeq: _*)
new Status(response.status)(response.bodyAsBytes)
.withHeaders(responseHeaders.removed("Content-Type").toSeq: _*)
.as(responseHeaders.getOrElse("Content-Type", "application/octet-stream"))
}
.recover {
case _ if config.isDev =>
Expand Down

0 comments on commit 9905b36

Please sign in to comment.