From ea17e9c2a3350ba670f95a6fa0ce7716adfa4176 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Fri, 25 Nov 2016 23:40:29 +0300 Subject: 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. --- src/Sproxy/Application/OAuth2/Common.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Sproxy/Application/OAuth2/Common.hs') 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 -- cgit v1.2.3