aboutsummaryrefslogtreecommitdiff
path: root/src/Sproxy/Application/OAuth2/Common.hs
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2016-11-25 23:40:29 +0300
committerIgor Pashev <pashev.igor@gmail.com>2016-11-25 23:51:25 +0300
commitea17e9c2a3350ba670f95a6fa0ce7716adfa4176 (patch)
tree1cde3e92d68a816a54ea7b0cca8af0b97e7c291e /src/Sproxy/Application/OAuth2/Common.hs
parent7ba0b2158124bbf10fbdeeec70fb7e631a32a364 (diff)
downloadsproxy2-ea17e9c2a3350ba670f95a6fa0ce7716adfa4176.tar.gz
Make sure all HTTP headers are UTF8-encoded
Especially X-Family-Name, X-Given-Name. Since we get all the data from JSON and JSON is in UTF8 by default RFC 7159, we are safe. Refactored to make it less error-prone and to get as small number of encoding/decoding as possible.
Diffstat (limited to 'src/Sproxy/Application/OAuth2/Common.hs')
-rw-r--r--src/Sproxy/Application/OAuth2/Common.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Sproxy/Application/OAuth2/Common.hs b/src/Sproxy/Application/OAuth2/Common.hs
index 07fb759..0324e62 100644
--- a/src/Sproxy/Application/OAuth2/Common.hs
+++ b/src/Sproxy/Application/OAuth2/Common.hs
@@ -8,6 +8,7 @@ module Sproxy.Application.OAuth2.Common (
import Control.Applicative (empty)
import Data.Aeson (FromJSON, parseJSON, Value(Object), (.:))
import Data.ByteString(ByteString)
+import Data.Text (Text)
import Sproxy.Application.Cookie (AuthUser)
@@ -29,7 +30,7 @@ type OAuth2Provider = (ByteString, ByteString) -> OAuth2Client
-- and expires_in because we don't use them, *and* expires_in creates troubles:
-- it's an integer from Google and string from LinkedIn (sic!)
data AccessTokenBody = AccessTokenBody {
- accessToken :: String
+ accessToken :: Text
} deriving (Eq, Show)
instance FromJSON AccessTokenBody where