]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/Resource/Internal.hs
Many bugfixes
[Lucu.git] / Network / HTTP / Lucu / Resource / Internal.hs
index e8aa3ef6b555da151896040e3d9640e25e9cec6f..9df36a601cf7dc460dd8b98f92ed084054719504 100644 (file)
@@ -41,6 +41,7 @@ import qualified Data.Ascii as A
 import qualified Data.ByteString as Strict
 import Data.List
 import Data.Maybe
+import Data.Monoid
 import Data.Monoid.Unicode
 import qualified Data.Text as T
 import Network.HTTP.Lucu.Abortion
@@ -52,7 +53,6 @@ import Network.HTTP.Lucu.Interaction
 import Network.HTTP.Lucu.Postprocess
 import Network.HTTP.Lucu.Request
 import Network.HTTP.Lucu.Response
-import Network.HTTP.Lucu.Utils
 import Network.Socket
 import OpenSSL.X509
 import Prelude hiding (catch)
@@ -166,12 +166,12 @@ spawnResource (ResourceDef {..}) ni@(NI {..})
               _      → error $ "Unknown request method: " ⧺ show (reqMethod req)
 
       notAllowed ∷ Resource ()
-      notAllowed
-          = setStatus MethodNotAllowed
-            *>
-            (setHeader "Allow" $ A.fromAsciiBuilder
-                               $ joinWith ", "
-                               $ map A.toAsciiBuilder allowedMethods)
+      notAllowed = do setStatus MethodNotAllowed
+                      setHeader "Allow"
+                          $ A.fromAsciiBuilder
+                          $ mconcat
+                          $ intersperse (A.toAsciiBuilder ", ")
+                          $ map A.toAsciiBuilder allowedMethods
 
       allowedMethods ∷ [Ascii]
       allowedMethods = nub $ concat [ methods resGet    ["GET"]