http-types 0.7

This commit is contained in:
Michael Snoyman 2012-07-06 16:24:24 +03:00
parent 29c242d03b
commit f3a3408260
7 changed files with 13 additions and 11 deletions

View File

@ -155,6 +155,7 @@ import Control.Arrow ((***))
import qualified Network.Wai.Parse as NWP import qualified Network.Wai.Parse as NWP
import Data.Monoid (mappend, mempty, Endo (..)) import Data.Monoid (mappend, mempty, Endo (..))
import qualified Data.ByteString.Char8 as S8 import qualified Data.ByteString.Char8 as S8
import Data.ByteString (ByteString)
import Data.CaseInsensitive (CI) import Data.CaseInsensitive (CI)
import qualified Data.CaseInsensitive as CI import qualified Data.CaseInsensitive as CI
import Blaze.ByteString.Builder (toByteString) import Blaze.ByteString.Builder (toByteString)
@ -808,7 +809,7 @@ handlerToYAR y s upload log' toMasterRoute render errorHandler rr murl sessionMa
types = httpAccept $ reqWaiRequest rr types = httpAccept $ reqWaiRequest rr
errorHandler' = localNoCurrent . errorHandler errorHandler' = localNoCurrent . errorHandler
yarToResponse :: YesodAppResult -> [(CI H.Ascii, H.Ascii)] -> W.Response yarToResponse :: YesodAppResult -> [(CI ByteString, ByteString)] -> W.Response
yarToResponse (YARWai a) _ = a yarToResponse (YARWai a) _ = a
yarToResponse (YARPlain s hs _ c _) extraHeaders = yarToResponse (YARPlain s hs _ c _) extraHeaders =
case c of case c of
@ -830,7 +831,7 @@ httpAccept = parseHttpAccept
-- | Convert Header to a key/value pair. -- | Convert Header to a key/value pair.
headerToPair :: Header headerToPair :: Header
-> (CI H.Ascii, H.Ascii) -> (CI ByteString, ByteString)
headerToPair (AddCookie sc) = headerToPair (AddCookie sc) =
("Set-Cookie", toByteString $ renderSetCookie $ sc) ("Set-Cookie", toByteString $ renderSetCookie $ sc)
headerToPair (DeleteCookie key path) = headerToPair (DeleteCookie key path) =

View File

@ -42,8 +42,8 @@ import qualified Network.HTTP.Types as H
import Data.String (IsString) import Data.String (IsString)
import qualified Data.Map as Map import qualified Data.Map as Map
import Data.Text.Lazy.Builder (Builder) import Data.Text.Lazy.Builder (Builder)
import Network.HTTP.Types (Ascii)
import Web.Cookie (SetCookie (..)) import Web.Cookie (SetCookie (..))
import Data.ByteString (ByteString)
-- | Responses to indicate some form of an error occurred. These are different -- | Responses to indicate some form of an error occurred. These are different
-- from 'SpecialResponse' in that they allow for custom error pages. -- from 'SpecialResponse' in that they allow for custom error pages.
@ -60,8 +60,8 @@ instance Exception ErrorResponse
-- | Headers to be added to a 'Result'. -- | Headers to be added to a 'Result'.
data Header = data Header =
AddCookie SetCookie AddCookie SetCookie
| DeleteCookie Ascii Ascii | DeleteCookie ByteString ByteString
| Header Ascii Ascii | Header ByteString ByteString
deriving (Eq, Show) deriving (Eq, Show)
langKey :: IsString a => a langKey :: IsString a => a

View File

@ -71,7 +71,7 @@ library
, monad-control >= 0.3 && < 0.4 , monad-control >= 0.3 && < 0.4
, transformers-base >= 0.4 , transformers-base >= 0.4
, cookie >= 0.4 && < 0.5 , cookie >= 0.4 && < 0.5
, http-types >= 0.6.5 && < 0.7 , http-types >= 0.7 && < 0.8
, case-insensitive >= 0.2 , case-insensitive >= 0.2
, parsec >= 2 && < 3.2 , parsec >= 2 && < 3.2
, directory >= 1 && < 1.2 , directory >= 1 && < 1.2

View File

@ -30,7 +30,7 @@ library
, wai >= 1.3 && < 1.4 , wai >= 1.3 && < 1.4
, text >= 0.9 && < 1.0 , text >= 0.9 && < 1.0
, file-embed >= 0.0.4.1 && < 0.5 , file-embed >= 0.0.4.1 && < 0.5
, http-types >= 0.6.5 && < 0.7 , http-types >= 0.7 && < 0.8
, unix-compat >= 0.2 , unix-compat >= 0.2
, conduit >= 0.5 && < 0.6 , conduit >= 0.5 && < 0.6
, crypto-conduit >= 0.4 && < 0.5 , crypto-conduit >= 0.4 && < 0.5
@ -61,7 +61,7 @@ test-suite tests
, wai , wai
, text >= 0.9 && < 1.0 , text >= 0.9 && < 1.0
, file-embed >= 0.0.4.1 && < 0.5 , file-embed >= 0.0.4.1 && < 0.5
, http-types >= 0.6.5 && < 0.7 , http-types
, unix-compat >= 0.2 , unix-compat >= 0.2
, conduit , conduit
, crypto-conduit , crypto-conduit

View File

@ -69,6 +69,7 @@ import qualified Test.Hspec.Runner as Runner
import qualified Data.List as DL import qualified Data.List as DL
import qualified Data.Maybe as DY import qualified Data.Maybe as DY
import qualified Data.ByteString.Char8 as BS8 import qualified Data.ByteString.Char8 as BS8
import Data.ByteString (ByteString)
import qualified Data.Text as T import qualified Data.Text as T
import qualified Data.Text.Encoding as TE import qualified Data.Text.Encoding as TE
import qualified Data.ByteString.Lazy.Char8 as BSL8 import qualified Data.ByteString.Lazy.Char8 as BSL8
@ -123,7 +124,7 @@ instance HoldsResponse OneSpecData where
instance HoldsResponse RequestBuilderData where instance HoldsResponse RequestBuilderData where
readResponse (RequestBuilderData _ x) = x readResponse (RequestBuilderData _ x) = x
type CookieValue = H.Ascii type CookieValue = ByteString
-- | Runs your test suite, using you wai 'Application' and 'ConnectionPool' for performing -- | Runs your test suite, using you wai 'Application' and 'ConnectionPool' for performing
-- the database queries in your tests. -- the database queries in your tests.

View File

@ -22,7 +22,7 @@ library
, wai >= 1.3 && < 1.4 , wai >= 1.3 && < 1.4
, wai-test >= 1.3 && < 1.4 , wai-test >= 1.3 && < 1.4
, network >= 2.2 && < 2.4 , network >= 2.2 && < 2.4
, http-types >= 0.6 && < 0.7 , http-types >= 0.7 && < 0.8
, HUnit >= 1.2 && < 1.3 , HUnit >= 1.2 && < 1.3
, hspec >= 1.2 && < 1.3 , hspec >= 1.2 && < 1.3
, bytestring >= 0.9 , bytestring >= 0.9

View File

@ -99,7 +99,7 @@ executable yesod
, unix-compat >= 0.2 && < 0.4 , unix-compat >= 0.2 && < 0.4
, containers >= 0.2 , containers >= 0.2
, attoparsec >= 0.10 , attoparsec >= 0.10
, http-types >= 0.6.1 && < 0.7 , http-types >= 0.7 && < 0.8
, blaze-builder >= 0.2.1.4 && < 0.4 , blaze-builder >= 0.2.1.4 && < 0.4
, filepath >= 1.1 , filepath >= 1.1
, process , process