[snowy] [api] Set correct content-type for OAuth responses



commit 23763f6dc474bcda877cfbce39fe418eb111e0ac
Author: Andrew Ruthven <andrew etc gen nz>
Date:   Wed May 18 20:47:36 2011 +0200

    [api] Set correct content-type for OAuth responses

 lib/piston/authentication.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/lib/piston/authentication.py b/lib/piston/authentication.py
index 63bec85..8512f0f 100644
--- a/lib/piston/authentication.py
+++ b/lib/piston/authentication.py
@@ -162,7 +162,7 @@ def oauth_request_token(request):
     try:
         token = oauth_server.fetch_request_token(oauth_request)
 
-        response = HttpResponse(token.to_string())
+        response = HttpResponse(token.to_string(), content_type="application/x-www-form-urlencoded")
     except oauth.OAuthError, err:
         response = send_oauth_error(err)
 
@@ -234,7 +234,7 @@ def oauth_access_token(request):
         
     try:
         token = oauth_server.fetch_access_token(oauth_request)
-        return HttpResponse(token.to_string())
+        return HttpResponse(token.to_string(), content_type="application/x-www-form-urlencoded")
     except oauth.OAuthError, err:
         return send_oauth_error(err)
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]