]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/Config.hs
docs
[Lucu.git] / Network / HTTP / Lucu / Config.hs
index 7549ae5c0e07d33886b6cb5ed64b741f45ecde7f..7a2d81f96586972b1cdc3bbd3969576a8ae92d10 100644 (file)
@@ -13,6 +13,8 @@ module Network.HTTP.Lucu.Config
     )
     where
 import Data.Ascii (Ascii)
+import Data.CaseInsensitive (CI)
+import qualified Data.CaseInsensitive as CI
 import Data.Text (Text)
 import qualified Data.Text as T
 import Network
@@ -22,6 +24,7 @@ import Network.HTTP.Lucu.MIMEType.DefaultExtensionMap
 #if defined(HAVE_SSL)
 import OpenSSL.Session
 #endif
+import Prelude.Unicode
 import System.IO.Unsafe
 
 -- |Configuration record for to run the httpd.
@@ -33,7 +36,7 @@ data Config = Config {
 
     -- |The host name of the server. This value will be used in
     -- built-in pages like \"404 Not Found\".
-    , cnfServerHost ∷ !Text
+    , cnfServerHost ∷ !(CI Text)
 
     -- |A port number (or a service name) to listen to HTTP clients.
     , cnfServerPort ∷ !ServiceName
@@ -105,7 +108,7 @@ data SSLConfig
 defaultConfig ∷ Config
 defaultConfig = Config {
                   cnfServerSoftware              = "Lucu/1.0"
-                , cnfServerHost                  = T.pack (unsafePerformIO getHostName)
+                , cnfServerHost                  = CI.mk ∘ T.pack $ unsafePerformIO getHostName
                 , cnfServerPort                  = "http"
                 , cnfServerV4Addr                = Just "0.0.0.0"
                 , cnfServerV6Addr                = Just "::"
@@ -117,3 +120,4 @@ defaultConfig = Config {
                 , cnfDumpTooLateAbortionToStderr = True
                 , cnfExtToMIMEType               = defaultExtensionMap
                 }
+-- FIXME: use data-default.