From 23a8c303f4bdba2aca28def57d2fd0bc328be2e9 Mon Sep 17 00:00:00 2001 From: Chen Wenlong Date: Tue, 20 Dec 2011 22:42:34 +0800 Subject: [PATCH] add empty realm field to header --- Web/Authenticate/OAuth.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Web/Authenticate/OAuth.hs b/Web/Authenticate/OAuth.hs index d48175be..5a7f0300 100644 --- a/Web/Authenticate/OAuth.hs +++ b/Web/Authenticate/OAuth.hs @@ -243,7 +243,7 @@ addAuthHeader (Credential cred) req = req { requestHeaders = insertMap "Authorization" (renderAuthHeader cred) $ requestHeaders req } renderAuthHeader :: [(BS.ByteString, BS.ByteString)] -> BS.ByteString -renderAuthHeader = ("OAuth " `BS.append`). BS.intercalate "," . map (\(a,b) -> BS.concat [paramEncode a, "=\"", paramEncode b, "\""]) . filter ((`elem` ["realm", "oauth_token", "oauth_verifier", "oauth_consumer_key", "oauth_signature_method", "oauth_timestamp", "oauth_nonce", "oauth_version", "oauth_callback", "oauth_signature"]) . fst) +renderAuthHeader = ("OAuth realm="\"\"," `BS.append`). BS.intercalate "," . map (\(a,b) -> BS.concat [paramEncode a, "=\"", paramEncode b, "\""]) . filter ((`elem` ["realm", "oauth_token", "oauth_verifier", "oauth_consumer_key", "oauth_signature_method", "oauth_timestamp", "oauth_nonce", "oauth_version", "oauth_callback", "oauth_signature"]) . fst) -- | Encode a string using the percent encoding method for OAuth. paramEncode :: BS.ByteString -> BS.ByteString