- compServer res
- = case getHeader "Server" res of
- Nothing -> return $ addHeader "Server" (cnfServerSoftware conf) res
- Just _ -> return res
-
- compDate res
- = case getHeader "Date" res of
- Nothing -> do time <- getClockTime
- return $ addHeader "Date" (formatHTTPDateTime time) res
- Just _ -> return res
\ No newline at end of file
+ compServer res'
+ = case getHeader "Server" res' of
+ Nothing → return $ setHeader "Server" (cnfServerSoftware conf) res'
+ Just _ → return res'
+
+ compDate res'
+ = case getHeader "Date" res' of
+ Nothing → do date ← getCurrentDate
+ return $ setHeader "Date" date res'
+ Just _ → return res'
+
+getCurrentDate ∷ IO Ascii
+getCurrentDate = HTTP.format <$> getCurrentTime