Skip to content

Commit

Permalink
fix(conformance): forbidden duplicate headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Saturn225 authored Sep 30, 2024
1 parent 969afa9 commit 698dd7c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ import zio.http._
*/
trait HeaderModifier[+A] { self =>
final def addHeader(header: Header): A =
addHeaders(Headers(header))
if (header.headerName == Header.XFrameOptions.name) {
updateHeaders(headers => Headers(headers.filterNot(_.headerName == Header.XFrameOptions.name)) ++ Headers(header))
} else {
addHeaders(Headers(header))
}

final def addHeader(name: CharSequence, value: CharSequence): A =
addHeaders(Headers.apply(name, value))
Expand Down

0 comments on commit 698dd7c

Please sign in to comment.