diff --git a/OpenId2/Discovery.hs b/OpenId2/Discovery.hs index 298ea885..f5ed0216 100644 --- a/OpenId2/Discovery.hs +++ b/OpenId2/Discovery.hs @@ -69,7 +69,7 @@ discoverYADIS :: ( MonadIO m discoverYADIS _ _ 0 = failure TooManyRedirects discoverYADIS ident mb_loc redirects = do let uri = fromMaybe (identifier ident) mb_loc - req <- parseUrl $ S8.pack uri + req <- parseUrl uri res <- liftIO $ withManager $ httpLbs req let mloc = fmap S8.unpack $ lookup "x-xrds-location" @@ -117,7 +117,7 @@ discoverHTML :: ( MonadIO m, Failure HttpException m) => Identifier -> m (Maybe Discovery) discoverHTML ident'@(Identifier ident) = - (parseHTML ident' . BSLU.toString) `liftM` simpleHttp (S8.pack ident) + (parseHTML ident' . BSLU.toString) `liftM` simpleHttp ident -- | Parse out an OpenID endpoint and an actual identifier from an HTML -- document. diff --git a/Web/Authenticate/Facebook.hs b/Web/Authenticate/Facebook.hs index 2c162f32..52862398 100644 --- a/Web/Authenticate/Facebook.hs +++ b/Web/Authenticate/Facebook.hs @@ -64,7 +64,7 @@ accessTokenUrl fb code = getAccessToken :: Facebook -> Text -> IO AccessToken getAccessToken fb code = do let url = accessTokenUrl fb code - b <- simpleHttp url + b <- simpleHttp $ S8.unpack url let (front, back) = splitAt 13 $ L8.unpack b case front of "access_token=" -> return $ AccessToken $ T.pack back @@ -80,7 +80,7 @@ graphUrl (AccessToken s) func = getGraphData :: AccessToken -> Text -> IO (Either String Value) getGraphData at func = do let url = graphUrl at func - b <- simpleHttp url + b <- simpleHttp $ S8.unpack url return $ eitherResult $ parse json b getGraphData' :: AccessToken -> Text -> IO Value diff --git a/Web/Authenticate/OAuth.hs b/Web/Authenticate/OAuth.hs index d58ff2bc..6ed25791 100644 --- a/Web/Authenticate/OAuth.hs +++ b/Web/Authenticate/OAuth.hs @@ -33,7 +33,6 @@ import Numeric import Codec.Crypto.RSA (rsassa_pkcs1_v1_5_sign, ha_SHA1, PrivateKey(..)) import Network.HTTP.Types (Header) import Control.Arrow (second) -import qualified Data.ByteString.Char8 as S8 import Blaze.ByteString.Builder (toByteString) import Data.Enumerator (($$), run_, Stream (..), continue) import Data.Monoid (mconcat) @@ -91,7 +90,7 @@ fromStrict = BSL.fromChunks . return getTemporaryCredential :: OAuth -- ^ OAuth Application -> IO Credential -- ^ Temporary Credential (Request Token & Secret). getTemporaryCredential oa = do - let req = fromJust $ parseUrl $ S8.pack $ oauthRequestUri oa + let req = fromJust $ parseUrl $ oauthRequestUri oa req' <- signOAuth oa emptyCredential (req { method = "POST" }) rsp <- withManager $ httpLbs req' let dic = parseQueryString . toStrict . responseBody $ rsp @@ -109,7 +108,7 @@ getAccessToken, getTokenCredential -> Credential -- ^ Temporary Credential with oauth_verifier -> IO Credential -- ^ Token Credential (Access Token & Secret) getAccessToken oa cr = do - let req = (fromJust $ parseUrl $ S8.pack $ oauthAccessTokenUri oa) { method = "POST" } + let req = (fromJust $ parseUrl $ oauthAccessTokenUri oa) { method = "POST" } rsp <- signOAuth oa cr req >>= withManager . httpLbs let dic = parseQueryString . toStrict . responseBody $ rsp return $ Credential dic diff --git a/Web/Authenticate/OpenId.hs b/Web/Authenticate/OpenId.hs index bb5cc508..752dfc3e 100644 --- a/Web/Authenticate/OpenId.hs +++ b/Web/Authenticate/OpenId.hs @@ -14,7 +14,6 @@ import OpenId2.Types import Web.Authenticate.Internal (qsUrl) import Control.Monad (unless) import qualified Data.ByteString.UTF8 as BSU -import qualified Data.ByteString.Char8 as S8 import qualified Data.ByteString.Lazy.UTF8 as BSLU import Network.HTTP.Enumerator ( parseUrl, urlEncodedBody, responseBody, httpLbsRedirect @@ -88,7 +87,7 @@ authenticate params = do let params' = map (BSU.fromString *** BSU.fromString) $ ("openid.mode", "check_authentication") : filter (\(k, _) -> k /= "openid.mode") params - req' <- parseUrl $ S8.pack endpoint + req' <- parseUrl endpoint let req = urlEncodedBody params' req' rsp <- liftIO $ withManager $ httpLbsRedirect req let rps = parseDirectResponse $ BSLU.toString $ responseBody rsp diff --git a/authenticate.cabal b/authenticate.cabal index 05455d66..b7d6f3c9 100644 --- a/authenticate.cabal +++ b/authenticate.cabal @@ -16,7 +16,7 @@ homepage: http://github.com/snoyberg/authenticate/tree/master library build-depends: base >= 4 && < 5, aeson >= 0.3.1.1 && < 0.4, - http-enumerator >= 0.5.1 && < 0.6, + http-enumerator >= 0.6 && < 0.7, tagsoup >= 0.6 && < 0.13, failure >= 0.0.0 && < 0.2, transformers >= 0.1 && < 0.3,