Update the replace logic to obey proper ordering

This commit is contained in:
Sibi Prabakaran 2017-07-13 12:42:30 +05:30
parent 8416bb6569
commit 18951b0de7
No known key found for this signature in database
GPG Key ID: D19E3E0EBB557613

View File

@ -809,9 +809,8 @@ replaceOrAddHeader a b =
replaceHeader header endo =
let allHeaders :: [Header] = appEndo endo []
in Endo
(\y ->
(header : y) ++
filter (\x -> not (sameHeaderName x header)) allHeaders)
(\rest ->
header : filter (\x -> not (sameHeaderName x header)) allHeaders ++ rest)
-- | Set the Cache-Control header to indicate this response should be cached
-- for the given number of seconds.