X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FPostprocess.hs;h=a8359758f9d90eaf107f58fc2bb4cf008b611cac;hb=c060bff37e29f06e105c0ec2b1f844f55b48906c;hp=29c3c5167cb375accbce646038b110a4a0b0b601;hpb=51eda5b02d4528e2e240cbfc228de02b1c83799a;p=Lucu.git diff --git a/Network/HTTP/Lucu/Postprocess.hs b/Network/HTTP/Lucu/Postprocess.hs index 29c3c51..a835975 100644 --- a/Network/HTTP/Lucu/Postprocess.hs +++ b/Network/HTTP/Lucu/Postprocess.hs @@ -47,15 +47,15 @@ abortOnCertainConditions (NI {..}) $ A.toAsciiBuilder "Inappropriate status code for a response: " ⊕ printStatusCode resStatus - when ( toStatusCode resStatus ≡ Just MethodNotAllowed ∧ - hasHeader "Allow" res ) + when ( resStatus ≈ MethodNotAllowed ∧ + hasHeader "Allow" res ) $ abort' $ A.toAsciiBuilder "The status was " ⊕ printStatusCode resStatus ⊕ A.toAsciiBuilder " but no \"Allow\" header." - when ( toStatusCode resStatus ≢ Just NotModified ∧ - isRedirection resStatus ∧ + when ( resStatus ≉ NotModified ∧ + isRedirection resStatus ∧ hasHeader "Location" res ) $ abort' $ A.toAsciiBuilder "The status code was " @@ -108,7 +108,7 @@ writeDefaultPageIfNeeded ni@(NI {..}) $ do writeHeader ni "Content-Type" $ Just defaultPageContentType writeHeader ni "Content-Encoding" Nothing res ← readTVar niResponse - let body = getDefaultPage niConfig (Just niRequest) res + let body = defaultPageForResponse niConfig (Just niRequest) res putTMVar niBodyToSend body completeUnconditionalHeaders ∷ NormalInteraction → STM ()