How can I remove the Server
HTTP response header in Yesod? I found code that's responsible for setting that header, but I don't know what to do next. I know that I can replace the header value with an empty string by using addHeader "Server" ""
, but I'd prefer to remove it entirely.
I made an issue on GitHub Warp repository and they changed it that when the server name is empty, the "Server" header is not sent. Therefore, the solution is to set the server name to an empty string using setServerName ""
. In my case I had to add this to the warpSettings
function in Application.hs
. Note that you have to use the Warp version which contains the fix (as of May 3 '17, it has not been released yet, but you can pull it directly from GitHub).